-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
86 lines (80 loc) · 2.64 KB
/
Copy pathdocker-compose.yml
File metadata and controls
86 lines (80 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# This Compose file runs the complete local development foundation with hot reload.
# Production images are built from the `production` stages in each Dockerfile.
name: ${COMPOSE_PROJECT_NAME:-chillyos}
services:
database:
# PostgreSQL 18 is pinned by major version while still receiving image security fixes.
image: postgres:18-alpine
restart: unless-stopped
shm_size: 128mb
environment:
POSTGRES_DB: ${POSTGRES_DB:?Copy .env.example to .env and set POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER:?Copy .env.example to .env and set POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Copy .env.example to .env and set POSTGRES_PASSWORD}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
# PostgreSQL 18 stores versioned data below this durable mount point.
- postgres_data:/var/lib/postgresql
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U \"$${POSTGRES_USER}\" -d \"$${POSTGRES_DB}\"",
]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
networks:
- chillyos
backend:
# The development stage adds reload behavior; the production stage stays immutable.
build:
context: ./backend
target: development
restart: unless-stopped
init: true
environment:
APP_NAME: ${APP_NAME:-ChillyOS Backend}
APP_ENV: ${APP_ENV:-development}
DATABASE_URL: ${DATABASE_URL:?Copy .env.example to .env and set DATABASE_URL}
SQL_ECHO: ${SQL_ECHO:-false}
ports:
- "${BACKEND_PORT:-8000}:8000"
volumes:
# Source mounting makes Uvicorn reload backend changes during development.
- ./backend:/app
depends_on:
database:
condition: service_healthy
networks:
- chillyos
frontend:
# The development stage contains tooling and starts the Next.js development server.
build:
context: ./frontend
target: development
restart: unless-stopped
init: true
environment:
NODE_ENV: development
NEXT_TELEMETRY_DISABLED: ${NEXT_TELEMETRY_DISABLED:-1}
ports:
- "${FRONTEND_PORT:-3000}:3000"
volumes:
# Source is live-mounted while dependency and build directories stay container-owned.
- ./frontend:/app
- frontend_node_modules:/app/node_modules
- frontend_next_cache:/app/.next
networks:
- chillyos
volumes:
# Named volumes preserve local database data and reusable frontend dependencies.
postgres_data:
frontend_node_modules:
frontend_next_cache:
networks:
# A private bridge gives services stable DNS names without exposing internal traffic.
chillyos:
driver: bridge