Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions compose/local/django/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ RUN apk --no-cache add build-base curl \
# Rust and Cargo required by the ``cryptography`` Python package
&& apk --no-cache add rust \
&& apk --no-cache add cargo \
# Nmap required by the ``python-nmap`` Python package.
&& apk --no-cache add nmap \
&& pip install --no-cache-dir -U setuptools pip

COPY ./requirements /requirements
Expand Down
7 changes: 7 additions & 0 deletions compose/production/django/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ RUN apk --no-cache add build-base curl \
# Rust and Cargo required by the ``cryptography`` Python package
&& apk --no-cache add rust \
&& apk --no-cache add cargo \
# Nmap required by the ``python-nmap`` Python package. libcap used to set the capabilities of nmap so root is not required
&& apk --no-cache add nmap libcap \
&& addgroup -S django \
&& adduser -S -G django django \
&& pip install --no-cache-dir -U setuptools pip
Expand Down Expand Up @@ -46,6 +48,11 @@ RUN sed -i 's/\r//' /start-queue \
&& chmod +x /start-queue \
&& chown django /start-queue

RUN chown django:django /usr/bin/nmap \
&& chmod 750 /usr/bin/nmap

RUN setcap cap_net_raw,cap_net_bind_service+eip /usr/bin/nmap

COPY ./compose/production/django/seed_data /seed_data

RUN sed -i 's/\r$//g' /seed_data \
Expand Down
1 change: 1 addition & 0 deletions production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ services:
- POSTGRES_USER=${POSTGRES_USER}
- REDIS_URL=redis://${REDIS_HOST}:${REDIS_PORT}/0
- WEB_CONCURRENCY=${DJANGO_WEB_CONCURRENCY}
- NMAP_PRIVILEGED=""
healthcheck:
test: curl --insecure --fail https://nginx/status/simple/ || exit 1
interval: ${HEALTHCHECK_INTERVAL}
Expand Down