Add Docker config

This commit is contained in:
Gabriel Augendre 2018-03-04 10:15:42 +01:00
parent ff144cd302
commit 10fb1167b4
No known key found for this signature in database
GPG key ID: F360212F958357D4
3 changed files with 17 additions and 0 deletions

15
Dockerfile Normal file
View file

@ -0,0 +1,15 @@
FROM python:3.6-alpine
WORKDIR /app
EXPOSE 8000
VOLUME /app/staticfiles
ENV DATABASE_URL postgres://postgresql:postgresql@db:5432/workout
RUN pip3 install pipenv
COPY Pipfile Pipfile.lock ./
RUN pipenv install
COPY . ./
RUN chmod +x bash/run-prod.sh
CMD bash/run-prod.sh

2
bash/run-prod.sh Normal file
View file

@ -0,0 +1,2 @@
#!/bin/sh
yes yes | python3 manage.py migrate && python3 manage.py collectstatic --noinput && gunicorn workout.wsgi -b 0.0.0.0:8000 --log-file -

View file