-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.dev.yml
More file actions
144 lines (128 loc) · 3.68 KB
/
compose.dev.yml
File metadata and controls
144 lines (128 loc) · 3.68 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
services:
www:
build:
target: dev
context: .
dockerfile: www/Dockerfile.bun
image: www-image
container_name: www-container
environment:
NODE_ENV: development
PORT: "3002"
env_file:
- .env
ports:
- "3002:3002"
volumes:
- ./www:/app/www:delegated
- www_cache:/app/.next/cache
networks:
- app-network
restart: unless-stopped
web:
build:
target: dev
context: .
dockerfile: web/Dockerfile.bun
image: web-image
container_name: web-container
environment:
NODE_ENV: development
PORT: "3001"
env_file:
- .env
ports:
- "3001:3001"
volumes:
- ./web:/app/web:delegated
- web_cache:/app/.next/cache
networks:
- app-network
restart: unless-stopped
# ============================================================
# api — backend service
# ============================================================
# api:
# build:
# context: .
# dockerfile: api/Dockerfile
# image: api-image
# container_name: api-container
# environment:
# NODE_ENV: production
# PORT: "4000"
# # DATABASE_URL: postgres://user:pass@db:5432/mydb
# ports:
# - "4000:4000"
# networks:
# - app-network
# # depends_on:
# # db:
# # condition: service_healthy
# # healthcheck:
# # test: ["CMD", "wget", "-qO-", "http://localhost:4000/health"]
# # interval: 30s
# # timeout: 10s
# # retries: 3
# restart: unless-stopped
# ============================================================
# shared — build-only image that others copy artifacts from
# (useful for a shared TypeScript package / design system)
# ============================================================
# shared:
# build:
# context: .
# dockerfile: shared/Dockerfile
# image: shared-image
# # No ports needed if this is just a build-time dependency
# ============================================================
# Optional: PostgreSQL database
# ============================================================
# db:
# image: postgres:16-alpine
# container_name: db-container
# environment:
# POSTGRES_USER: user
# POSTGRES_PASSWORD: pass
# POSTGRES_DB: mydb
# volumes:
# - pg_data:/var/lib/postgresql/data
# ports:
# - "5432:5432"
# networks:
# - app-network
# healthcheck:
# test: ["CMD-SHELL", "pg_isready -U user -d mydb"]
# interval: 10s
# timeout: 5s
# retries: 5
# restart: unless-stopped
# ============================================================
# Optional: Redis cache
# ============================================================
# redis:
# image: redis:7-alpine
# container_name: redis-container
# ports:
# - "6379:6379"
# volumes:
# - redis_data:/data
# networks:
# - app-network
# restart: unless-stopped
# ==============================================================================
# Networks
# ==============================================================================
networks:
app-network:
driver: bridge
# ── Use an existing external network (e.g. shared across projects) ────
# external: true
# ==============================================================================
# Volumes
# ==============================================================================
volumes:
# pg_data: # persists Postgres data across container restarts
# redis_data: # persists Redis data
www_cache: # persists Next.js cache for www
web_cache: # persists Next.js cache for web