Commit d4f76b9f authored by Lukas Matt's avatar Lukas Matt

Add socialhome docker image

parent 7c027be3
DATABASE_URL=postgres://postgres@127.0.0.1:5432/NAME
DJANGO_SETTINGS_MODULE=config.settings.production
DJANGO_SECRET_KEY=m0jv6^ls^thsm!n%5$uk-347da$3c$14j5aue)g3e)hn8&d6ll
DJANGO_ALLOWED_HOSTS=localhost
DJANGO_SECURE_SSL_REDIRECT=False
DJANGO_ACCOUNT_ALLOW_REGISTRATION=True
SOCIALHOME_DOMAIN=localhost:PORT
SOCIALHOME_HTTPS=False
SOCIALHOME_LOGFILE=/socialhome/socialhome.log
# enable federation
DJANGO_DEBUG=False
FROM python:3
RUN apt-get update
RUN apt-get install -y git-core
RUN git clone https://github.com/jaywink/socialhome.git
WORKDIR /socialhome
RUN bash install_ubuntu_dependencies.sh install
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get install -y nodejs
RUN pip install -U pip setuptools==30.4 pip-tools
RUN pip-sync dev-requirements.txt
RUN npm install
RUN npm install -g bower
RUN bower install --allow-root
RUN npm -g install grunt
RUN npm run build
# XXX workaround for validating localhost domain name
RUN sed -i 's/\\\.//' src/federation/federation/utils/text.py
# XXX hotfix http fallback support in development mode
# see https://github.com/jaywink/federation/issues/120
RUN sed -i 's/raise_ssl_errors=True/raise_ssl_errors=False/' \
src/federation/federation/utils/network.py
RUN sed -i 's/return "https/return "http/g' \
src/federation/federation/utils/diaspora.py
COPY .env /socialhome/.env
COPY start.sh /start.sh
CMD [ "/bin/bash", "/start.sh" ]
#!/bin/bash
if [ "$PROJECT" == "socialhome" ]; then
# fetch user repo
cd /socialhome && git stash \
&& git remote add custom $PRREPO \
&& git fetch custom \
&& git checkout $PRSHA \
&& git stash pop \
&& git log -1 || {
echo "Cannot find $PRREPO $PRSHA"
exit 1
}
# re-install dependencies
cd /socialhome \
&& pip-sync dev-requirements.txt \
&& manage.py migrate \
&& npm run dev
fi
sed -i "s/NAME/$DATABASE/g" /socialhome/.env
sed -i "s/PORT/$PORT/g" /socialhome/.env
python manage.py migrate
python manage.py collectstatic
#python manage.py rebuild_index
python manage.py runserver localhost:$PORT &
tail -f /socialhome/socialhome.log
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment