aboutsummaryrefslogtreecommitdiffstats
path: root/docker/app/local.Dockerfile
blob: 2c95cea340a5588af2591af7a2b612c531021e6f (plain) (blame)
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
FROM bitnami/python:3.7-prod

STOPSIGNAL SIGQUIT

ENV PIP_NO_CACHE_DIR=false \
    PIPENV_HIDE_EMOJIS=1 \
    PIPENV_NOSPIN=1

# Create a user.
RUN useradd --system --shell /bin/false --uid 1500 pysite

# Install prerequisites needed to complete the dependency installation.
RUN install_packages git gcc libc-dev libpq-dev

# Copy the project files into the working directory.
WORKDIR /app
COPY . .

# Update setuptools by removing egg first, add other dependencies
RUN rm -r /opt/bitnami/python/lib/python3.*/site-packages/setuptools* && \
    pip install -U setuptools
RUN pip install pipenv uwsgi
RUN pipenv install --system --deploy

RUN SECRET_KEY=placeholder DATABASE_URL=sqlite:// python3 manage.py collectstatic --no-input --clear --verbosity 0

CMD ["uwsgi", "--ini", "docker/app/uwsgi.ini"]