add backend Docker dev service with hot reload.

Wire Nest into dev compose with src bind mount and health-check probe.
This commit is contained in:
2026-09-27 23:06:19 +02:00
parent a785ce775f
commit 572844bc73
2 changed files with 35 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
FROM node:20-alpine
WORKDIR /backend
RUN apk add --no-cache curl
COPY package*.json .
RUN npm ci
COPY . .
CMD ["npm", "run", "start:dev"]
+22
View File
@@ -30,6 +30,28 @@ services:
postgres:
condition: service_healthy
backend:
build:
context: ./backend
dockerfile: Dockerfile.dev
container_name: ${COMPOSE_PROJECT_NAME}_backend
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
env_file:
- .env.dev
ports:
- '${BACKEND_PORT}:${BACKEND_PORT}'
volumes:
- ./backend/src:/backend/src
healthcheck:
test: ['CMD-SHELL', 'curl -f http://backend:${BACKEND_PORT}/api/health-check/']
interval: 1s
timeout: 30s
retries: 20
start_period: 10s
volumes:
private_image_postgres_data:
private_image_pgadmin_data: