Add docker files

This commit is contained in:
Gabriel Augendre 2018-05-25 14:46:27 +02:00
parent 20ef3ce11d
commit 8828b8e7b7
3 changed files with 33 additions and 0 deletions

4
.dockerignore Normal file
View File

@ -0,0 +1,4 @@
db.sqlite3
.idea
.env
staticfiles

25
Dockerfile Normal file
View File

@ -0,0 +1,25 @@
FROM python:3.6
RUN ln -fs /usr/share/zoneinfo/Europe/Paris /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata
WORKDIR /app
EXPOSE 8000
VOLUME /app/staticfiles
RUN pip3 install pipenv
COPY Pipfile Pipfile.lock ./
RUN pipenv install
COPY . ./
RUN chmod +x bash/run-prod.sh
CMD bash/run-prod.sh
ENV DATABASE_URL postgres://postgresql:postgresql@db:5432/workout
ENV SECRET_KEY ''
ENV MAILGUN_ACCESS_KEY ''
ENV MAILGUN_SERVER_NAME ''
ENV DJANGO_ENV ''
ENV ADMIN_EMAIL ''
ENV SERVER_EMAIL ''

4
bash/run-prod.sh Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
yes yes | pipenv run python manage.py migrate && \
pipenv run python manage.py collectstatic --noinput && \
pipenv run gunicorn manuels_collection.wsgi -b 0.0.0.0:8000 --log-file -