Browse Source

Add docker files

master
Gabriel Augendre 3 years ago
parent
commit
8828b8e7b7
  1. 4
      .dockerignore
  2. 25
      Dockerfile
  3. 4
      bash/run-prod.sh

4
.dockerignore

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

25
Dockerfile

@ -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

@ -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 -
Loading…
Cancel
Save