From d71309202b31f376b3a2ac2704de6acfdc4c5aaa Mon Sep 17 00:00:00 2001 From: Chris Adams Date: Wed, 15 May 2024 19:57:45 +0200 Subject: [PATCH] Fix typo in final Dockerfile line --- Dockerfile | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index a69090ea..1afcc6cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,18 +18,18 @@ RUN apt-get clean RUN rm -rf /var/lib/apt/lists/* # Install dependencies in a virtualenv -# ENV VIRTUAL_ENV=/app/.venv +ENV VIRTUAL_ENV=/app/.venv -RUN useradd deploy --create-home && mkdir /app /app/.venv && chown -R deploy /app /app/.venv -# RUN useradd deploy --create-home && mkdir /app $VIRTUAL_ENV && chown -R deploy /app $VIRTUAL_ENV +# RUN useradd deploy --create-home && mkdir /app /app/.venv && chown -R deploy /app /app/.venv +RUN useradd deploy --create-home && mkdir /app $VIRTUAL_ENV && chown -R deploy /app $VIRTUAL_ENV WORKDIR /app # Adding the virtual environment to the path saves us needing to # run `source /app/.venv/bin/activate`, and adding python path # makes it easier to run manage.py commands -# ENV PATH=$VIRTUAL_ENV/bin:$PATH \ -# PYTHONPATH=/app +ENV PATH=$VIRTUAL_ENV/bin:$PATH \ + PYTHONPATH=/app # Default port exposed by this container EXPOSE 9000 @@ -49,8 +49,8 @@ RUN python -m pip install uv==0.1.39 wheel --upgrade # from our final build artefact COPY --chown=deploy . . -# Install dependencies via uv -RUN uv pip install -r requirements/requirements.linux.generated.txt +# Install dependencies via uv into /app/.venv/ +RUN python -m pip install -r requirements/requirements.linux.generated.txt # Set up front end pipeline RUN python ./manage.py tailwind install @@ -70,4 +70,6 @@ RUN python ./manage.py collectstatic --noinput --clear # Use the shell form of CMD, so we have access to our environment variables # $GUNICORN_CMD_ARGS allows us to add additional arguments to the gunicorn command -CMD /bin/sh /app/.venv/bin/gunicorn greenweb.wsgi --bind $GUNICORN_BIND_IP:$PORT --config gunicorn.conf.py $GUNICORN_CMD_ARGS + + +CMD /app/.venv/bin/gunicorn greenweb.wsgi --bind $GUNICORN_BIND_IP:$PORT --config gunicorn.conf.py $GUNICORN_CMD_ARGS