File tree Expand file tree Collapse file tree 6 files changed +220
-45
lines changed
Expand file tree Collapse file tree 6 files changed +220
-45
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ services:
55 container_name : mapdb-postgres-debugger
66 image : postgres:18
77 volumes :
8- - ${POSTGRES_DATA_DIR}/debugger-db/:/var/lib/postgresql/18/docker
8+ - ${POSTGRES_DATA_DIR}/debugger-db/:/var/lib/postgresql
99 environment :
1010 - POSTGRES_DB=${POSTGRES_DB}
1111 - POSTGRES_USER=${POSTGRES_USER}
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ services:
33 container_name : mapdb-postgres
44 image : postgres:18
55 volumes :
6- - ${POSTGRES_DATA_DIR}:/var/lib/postgresql/18/docker
6+ - ${POSTGRES_DATA_DIR}:/var/lib/postgresql
77 environment :
88 - POSTGRES_DB=${POSTGRES_DB}
99 - POSTGRES_USER=${POSTGRES_USER}
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ services:
33 container_name : mapdb-postgres-dev
44 image : postgres:18
55 volumes :
6- - ${POSTGRES_DATA_DIR}:/var/lib/postgresql/18/docker
6+ - ${POSTGRES_DATA_DIR}:/var/lib/postgresql
77 environment :
88 - POSTGRES_DB=${POSTGRES_DB}
99 - POSTGRES_USER=${POSTGRES_USER}
Original file line number Diff line number Diff line change @@ -4,38 +4,29 @@ FROM python:3.12-bookworm AS base
44ENV PYTHONDONTWRITEBYTECODE=1
55ENV PYTHONUNBUFFERED=1
66
7- # Configurable user setup
8- ENV USER=cncnet
9- ENV UID=1000
10-
117WORKDIR /cncnet-map-api
128
139# Install system dependencies
1410RUN apt-get update && apt-get install -y liblzo2-dev libmagic1
1511
16- # Create non-root user with configurable name and UID
17- RUN useradd -m -u ${UID} ${USER}
1812
1913# Copy necessary files for the build
2014COPY requirements.txt /cncnet-map-api
2115COPY requirements-dev.txt /cncnet-map-api
2216COPY web_entry_point.sh /cncnet-map-api
2317
2418# Set permissions and make script executable
25- RUN chmod +x /cncnet-map-api/web_entry_point.sh && \
26- chown -R ${USER}:${USER} /cncnet-map-api
19+ RUN chmod +x /cncnet-map-api/web_entry_point.sh
2720
2821RUN pip install --upgrade pip
2922
3023FROM base AS dev
3124RUN pip install -r ./requirements-dev.txt
32- USER ${USER}
3325ENTRYPOINT ["/cncnet-map-api/web_entry_point.sh" ]
3426
3527FROM base AS prod
3628COPY . /cncnet-map-api
3729RUN pip install -r ./requirements.txt
38- USER ${USER}
3930ENTRYPOINT ["/cncnet-map-api/web_entry_point.sh" ]
4031
4132FROM base AS debugger
Original file line number Diff line number Diff line change @@ -15,11 +15,13 @@ http {
1515 alias /usr/share/nginx/html/static/; # The nginx container's mounted volume.
1616 expires 30d ;
1717 add_header Cache-Control public;
18+ include /etc/nginx/mime.types ;
1819 }
1920
2021 # Serve user uploaded files
2122 location /silo/ {
2223 alias /usr/share/nginx/html/silo/; # The container's mounted volume.
24+ include /etc/nginx/mime.types ;
2325 }
2426
2527 # Proxy requests to the Django app running in gunicorn
2931 proxy_set_header X-Real-IP $remote_addr ;
3032 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
3133 proxy_set_header X-Forwarded-Proto $scheme ;
34+ proxy_redirect off;
3235 }
3336 }
3437}
You can’t perform that action at this time.
0 commit comments