diff options
| author | Mitchell Riedstra <mitch@riedstra.dev> | 2021-10-14 17:01:23 -0400 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@riedstra.dev> | 2021-10-14 17:01:23 -0400 |
| commit | 067f8f92b568527e94e2a04fa495f86f1820a4bc (patch) | |
| tree | e641dd94a99ab433f9a2a245c85d9b16a7aa0fed /Dockerfile | |
| parent | 5369537388a3239f3f19080053fcdab6ad9b95eb (diff) | |
| download | dispatch-tracker-067f8f92b568527e94e2a04fa495f86f1820a4bc.tar.gz dispatch-tracker-067f8f92b568527e94e2a04fa495f86f1820a4bc.tar.xz | |
Move to environment vars. Create a container that sets up a demo.
Instead of the old method with scripts, docker-compose file, everything
is pulled into the main container with various configuration options
allowed from environment variables.
Also move settings.py away from the old yaml setup and pull directly
from the environment instead.
Diffstat (limited to 'Dockerfile')
| -rw-r--r-- | Dockerfile | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -1,6 +1,8 @@ -FROM alpine:latest +FROM docker.io/alpine:3.14 -RUN apk update && apk add python3 py3-setuptools py3-virtualenv postgresql-client +RUN apk update +RUN apk add nginx python3 py3-pip py3-setuptools py3-virtualenv \ + postgresql-client py3-psycopg2 postgresql RUN apk add linux-headers postgresql-dev gcc python3-dev libc-dev COPY app/requirements.txt /requirements.txt @@ -8,17 +10,17 @@ RUN pip3 install --no-cache-dir -r /requirements.txt RUN rm /requirements.txt RUN pip3 install --no-cache-dir uwsgi - RUN apk del linux-headers postgresql-dev gcc python3-dev libc-dev -# Feel free to change the UID if necessary -RUN adduser -D -H -u 1000 app +RUN mkdir /app /static -# RUN apk add uwsgi-python3 +COPY app /app +WORKDIR /app -RUN mkdir /app /static && chown app /app /static +ENV STATIC_ROOT=/static -USER app +RUN python3 manage.py collectstatic -CMD [ "uwsgi", "--ini", "/app/uwsgi.ini" ] +COPY entrypoint.sh / +ENTRYPOINT /entrypoint.sh |
