From 067f8f92b568527e94e2a04fa495f86f1820a4bc Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Thu, 14 Oct 2021 17:01:23 -0400 Subject: 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. --- Dockerfile | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 476dccd..35ad256 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 -- cgit v1.2.3