-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
57 lines (52 loc) · 1.11 KB
/
docker-compose.yml
File metadata and controls
57 lines (52 loc) · 1.11 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
services:
db:
image: postgres:15
environment:
POSTGRES_DB: drawsomething
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- postgres_data:/var/lib/postgresql/data
# 移除对外端口暴露 - 只允许内部访问,开发环境需要放开限制
# ports:
# - "5432:5432"
networks:
- internal
restart: unless-stopped
# 生产环境移除或限制访问,开发环境可启用,用于数据库管理
# adminer:
# image: adminer
# ports:
# - "8080:8080"
# networks:
# - internal
# restart: unless-stopped
# depends_on:
# - db
backend:
build: .
ports:
- "8002:8002"
volumes:
- ./backend:/app
environment:
- DATABASE_URL=postgresql://postgres:postgres@db:5432/drawsomething
depends_on:
- db
networks:
- internal
restart: unless-stopped
frontend:
build: ./frontend
ports:
- "5175:5175"
networks:
- internal
depends_on:
- backend
restart: unless-stopped
networks:
internal:
driver: bridge
volumes:
postgres_data: