Skip to content

Commit 4d32506

Browse files
Update code
1 parent f35cc5e commit 4d32506

4 files changed

Lines changed: 47 additions & 46 deletions

File tree

backend/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ clean-backend-docker:
2828
@docker container rm -f nest-nestbot >/dev/null 2>&1 || true
2929
@docker container rm -f nest-worker >/dev/null 2>&1 || true
3030
@docker image rm -f nest-backend:base >/dev/null 2>&1 || true
31-
@docker image rm -f nest-nestbot:base >/dev/null 2>&1 || true
3231
@docker image rm -f nest-local-backend >/dev/null 2>&1 || true
3332
@docker image rm -f nest-local-nestbot >/dev/null 2>&1 || true
3433
@docker image rm -f nest-snapshot-video >/dev/null 2>&1 || true

docker-compose/local/compose.yaml

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ services:
2424
DJANGO_DB_USER: ${DJANGO_DB_USER:-nest_user_dev}
2525
DJANGO_REDIS_HOST: ${DJANGO_REDIS_HOST:-nest-cache}
2626
DJANGO_REDIS_PASSWORD: ${DJANGO_REDIS_PASSWORD:-nest-cache-password}
27-
# Disable Slack in backend - routes won't be registered
27+
# Disable Slack in backend - routes won't be registered.
2828
DJANGO_SLACK_BOT_TOKEN: None
2929
DJANGO_SLACK_SIGNING_SECRET: None
3030
networks:
@@ -35,39 +35,6 @@ services:
3535
- ../../backend:/home/owasp
3636
- backend-venv:/home/owasp/.venv
3737

38-
nestbot:
39-
container_name: nest-nestbot
40-
command: >
41-
sh -c '
42-
python manage.py migrate &&
43-
python manage.py runserver 0.0.0.0:8001
44-
'
45-
image: nest-local-nestbot
46-
build:
47-
context: ../../backend
48-
dockerfile: ../docker/backend/Dockerfile.nestbot.local
49-
depends_on:
50-
cache:
51-
condition: service_healthy
52-
db:
53-
condition: service_healthy
54-
env_file: ../../backend/.env
55-
environment:
56-
DJANGO_DB_HOST: ${DJANGO_DB_HOST:-db}
57-
DJANGO_DB_NAME: ${DJANGO_DB_NAME:-nest_db_dev}
58-
DJANGO_DB_PASSWORD: ${DJANGO_DB_PASSWORD:-nest_user_dev_password}
59-
DJANGO_DB_PORT: ${DJANGO_DB_PORT:-5432}
60-
DJANGO_DB_USER: ${DJANGO_DB_USER:-nest_user_dev}
61-
DJANGO_REDIS_HOST: ${DJANGO_REDIS_HOST:-nest-cache}
62-
DJANGO_REDIS_PASSWORD: ${DJANGO_REDIS_PASSWORD:-nest-cache-password}
63-
networks:
64-
- nest-network
65-
ports:
66-
- 8001:8001
67-
volumes:
68-
- ../../backend:/home/owasp
69-
- nestbot-venv:/home/owasp/.venv
70-
7138
cache:
7239
command: >
7340
sh -c '
@@ -144,6 +111,40 @@ services:
144111
- frontend-next:/home/owasp/.next
145112
- frontend-node-modules:/home/owasp/node_modules
146113

114+
nestbot:
115+
container_name: nest-nestbot
116+
command: >
117+
sh -c '
118+
python manage.py runserver 0.0.0.0:8001
119+
'
120+
image: nest-local-nestbot
121+
build:
122+
context: ../../backend
123+
dockerfile: ../docker/backend/Dockerfile.nestbot.local
124+
depends_on:
125+
backend:
126+
condition: service_started
127+
cache:
128+
condition: service_healthy
129+
db:
130+
condition: service_healthy
131+
env_file: ../../backend/.env
132+
environment:
133+
DJANGO_DB_HOST: ${DJANGO_DB_HOST:-db}
134+
DJANGO_DB_NAME: ${DJANGO_DB_NAME:-nest_db_dev}
135+
DJANGO_DB_PASSWORD: ${DJANGO_DB_PASSWORD:-nest_user_dev_password}
136+
DJANGO_DB_PORT: ${DJANGO_DB_PORT:-5432}
137+
DJANGO_DB_USER: ${DJANGO_DB_USER:-nest_user_dev}
138+
DJANGO_REDIS_HOST: ${DJANGO_REDIS_HOST:-nest-cache}
139+
DJANGO_REDIS_PASSWORD: ${DJANGO_REDIS_PASSWORD:-nest-cache-password}
140+
networks:
141+
- nest-network
142+
ports:
143+
- 8001:8001
144+
volumes:
145+
- ../../backend:/home/owasp
146+
- nestbot-venv:/home/owasp/.venv
147+
147148
worker:
148149
container_name: nest-worker
149150
command: >
@@ -167,7 +168,6 @@ services:
167168
DJANGO_DB_USER: ${DJANGO_DB_USER:-nest_user_dev}
168169
DJANGO_REDIS_HOST: ${DJANGO_REDIS_HOST:-nest-cache}
169170
DJANGO_REDIS_PASSWORD: ${DJANGO_REDIS_PASSWORD:-nest-cache-password}
170-
# Worker needs Slack tokens for SlackConfig.app.client (inherited from .env)
171171
networks:
172172
- nest-network
173173
volumes:

docker/backend/Dockerfile.local

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# python:slim is used as base image to keep the image size small
2-
FROM python:3.13-slim AS builder
2+
FROM python:3.13.7-slim AS builder
33

44
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
55

@@ -13,8 +13,8 @@ ENV OWASP_GID=1000 \
1313
RUN apt-get update && apt-get install -y --no-install-recommends \
1414
build-essential \
1515
libffi-dev \
16-
libssl-dev \
1716
libpq-dev \
17+
libssl-dev \
1818
passwd \
1919
&& rm -rf /var/lib/apt/lists/* && \
2020
groupadd -g ${OWASP_GID} owasp && \
@@ -31,10 +31,10 @@ WORKDIR /home/owasp
3131
COPY --chmod=444 --chown=root:root poetry.lock pyproject.toml ./
3232
RUN --mount=type=cache,target=${POETRY_CACHE_DIR},uid=${OWASP_UID},gid=${OWASP_GID} \
3333
--mount=type=cache,target=${PIP_CACHE_DIR} \
34-
poetry install --no-root --without dev --without test --without video --without nestbot
34+
poetry install --no-root --without dev --without nestbot --without test --without video
3535

3636
# Runtime stage using python:slim
37-
FROM python:3.13-slim
37+
FROM python:3.13.7-slim
3838

3939
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
4040

@@ -45,14 +45,15 @@ ENV FORCE_COLOR=1 \
4545

4646
RUN apt-get update && \
4747
apt-get install -y --no-install-recommends \
48-
postgresql-client \
48+
curl \
4949
libpq5 \
5050
passwd \
51-
curl \
51+
postgresql-client \
5252
&& rm -rf /var/lib/apt/lists/* && \
5353
groupadd -g 1000 owasp && \
5454
useradd -u 1000 -g owasp -m -s /bin/bash owasp
5555

56+
# Install poetry for runtime (needed for volume-based development setup)
5657
RUN --mount=type=cache,target=${PIP_CACHE_DIR} \
5758
python -m pip install poetry --cache-dir ${PIP_CACHE_DIR}
5859

docker/backend/Dockerfile.nestbot.local

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ ENV OWASP_GID=1000 \
1313
RUN apt-get update && apt-get install -y --no-install-recommends \
1414
build-essential \
1515
libffi-dev \
16-
libssl-dev \
1716
libpq-dev \
17+
libssl-dev \
1818
passwd \
1919
&& rm -rf /var/lib/apt/lists/* && \
2020
groupadd -g ${OWASP_GID} owasp && \
@@ -34,7 +34,7 @@ RUN --mount=type=cache,target=${POETRY_CACHE_DIR},uid=${OWASP_UID},gid=${OWASP_G
3434
poetry install --no-root --without dev --without test --without video
3535

3636
# Runtime stage using python:slim
37-
FROM python:3.13-slim
37+
FROM python:3.13.7-slim
3838

3939
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
4040

@@ -45,14 +45,15 @@ ENV FORCE_COLOR=1 \
4545

4646
RUN apt-get update && \
4747
apt-get install -y --no-install-recommends \
48-
postgresql-client \
48+
curl \
4949
libpq5 \
5050
passwd \
51-
curl \
51+
postgresql-client \
5252
&& rm -rf /var/lib/apt/lists/* && \
5353
groupadd -g 1000 owasp && \
5454
useradd -u 1000 -g owasp -m -s /bin/bash owasp
5555

56+
# Install poetry for runtime (needed for volume-based development setup)
5657
RUN --mount=type=cache,target=${PIP_CACHE_DIR} \
5758
python -m pip install poetry --cache-dir ${PIP_CACHE_DIR}
5859

0 commit comments

Comments
 (0)