Skip to content

Commit

Permalink
fixup! Update Django Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronxsu committed Dec 20, 2024
1 parent b2c0914 commit e0ea151
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/django/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ FROM python:3.10-slim-bullseye
WORKDIR /usr/src
COPY requirements.txt /tmp/

ARG buildDeps=" build-essential libpq-dev"
ARG deps=" gdal-bin libgdal-dev gettext postgresql-client"

RUN apt-get update && apt-get install -y $buildDeps $deps --no-install-recommends
RUN pip3 install --no-cache-dir -r /tmp/requirements.txt
RUN apt-get purge -y --auto-remove $buildDeps
RUN set -ex \
&& buildDeps=" \
build-essential \
libpq-dev \
" \
&& deps=" \
gdal-bin \
libgdal-dev \
gettext \
postgresql-client-13 \
" \
&& apt-get update && apt-get install -y $buildDeps $deps --no-install-recommends \
&& pip install --no-cache-dir -r /tmp/requirements.txt \
&& apt-get purge -y --auto-remove $buildDeps \
&& rm -rf /tmp/requirements.txt /var/lib/apt/lists/*

COPY . /usr/src

Expand Down
1 change: 1 addition & 0 deletions src/django/gunicorn.conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
accesslog = "-"
errorlog = "-"
workers = 3
worker_class = 'gevent'
loglevel = "Info"

ENVIRONMENT = os.getenv("DJANGO_ENV", "dev")
Expand Down

0 comments on commit e0ea151

Please sign in to comment.