Skip to content
Merged
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
14 changes: 12 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
FROM node:20-alpine
# ── Build stage ──────────────────────────────────────────────────────────────
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
# Install all deps (including devDependencies) so tsc is available
RUN npm ci
COPY . .
RUN npm run build

# ── Runtime stage ─────────────────────────────────────────────────────────────
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
# Install production deps only for the final image
RUN npm ci --omit=dev
COPY --from=builder /app/dist ./dist
EXPOSE 4000
CMD ["node", "dist/index.js"]
9 changes: 8 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ services:
FCM_TOPIC: ${FCM_TOPIC:-freeze_alerts}
volumes:
- backend_data:/data
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:4000/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s

frontend:
build:
Expand All @@ -29,7 +35,8 @@ services:
ports:
- "3000:3000"
depends_on:
- backend
backend:
condition: service_healthy

volumes:
backend_data:
Loading