forked from stellar/django-polaris
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (29 loc) · 1.23 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Python version
FROM python:3.7-alpine
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Install system dependencies
RUN apk update && apk add build-base postgresql-dev libffi-dev gettext-dev curl postgresql-client
# Copy files to working directory
RUN mkdir /code /code/polaris /code/data
COPY ./example ./setup.py ./README.rst ./MANIFEST.in /code/
COPY ./polaris /code/polaris/
# Set fake environment variables so manage.py commands can run.
# django-environ's env() function uses variables defined in the
# environment over matching variables in the .env file, so these
# variables will be overidden in production, and won't be defined
# if a .env file already exists.
RUN if [ ! -f /code/.env ]; then echo $'\
SIGNING_SEED=SB4XM7E6ZP4NIQF3UNVMX5O5NH7RGHFHDLIS4Z5U4OMNQ7T4EDNKPVNU\n\
HOST_URL=https://fake.com\n\
SERVER_JWT_KEY=notsosecretkey\n\
DJANGO_SECRET_KEY=notsosecretkey\
' >> /code/.env; fi
# Install dependencies
WORKDIR /code
RUN pip install pipenv; pipenv install --dev --system
# collect static assets
RUN python manage.py collectstatic --no-input --ignore=*.scss
# Overridden by heroku.yml's run phrase in deployment
CMD python manage.py migrate; python manage.py runserver --nostatic 0.0.0.0:8000