-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
63 lines (60 loc) · 1.75 KB
/
Copy pathdocker-compose.yml
File metadata and controls
63 lines (60 loc) · 1.75 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
services:
postgres:
build:
context: .
dockerfile_inline: "FROM postgres:16-alpine"
image: crewspace-postgres
container_name: crewspace-postgres
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-crewspace}
POSTGRES_USER: ${POSTGRES_USER:-crewspace}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme_strong_password}
TZ: Asia/Seoul
volumes:
- crewspace_pgdata:/var/lib/postgresql/data
ports:
- "${HOST_POSTGRES_PORT:-5432}:5432"
healthcheck:
# 초기화용 임시 서버는 유닉스 소켓만 열고 TCP를 열지 않으며,
# pg_isready는 DB 존재 여부를 검사하지 않아 초기화 중에도 통과한다.
# TCP로 대상 DB에 실제 쿼리를 실행해 진짜 준비 상태만 통과시킨다.
test: ['CMD-SHELL', 'PGPASSWORD="$$POSTGRES_PASSWORD" psql -h 127.0.0.1 -U "$$POSTGRES_USER" -d "$$POSTGRES_DB" -c "SELECT 1" >/dev/null 2>&1']
interval: 5s
timeout: 5s
retries: 20
start_period: 60s
backend:
build:
context: ./backend
dockerfile: Dockerfile
image: crewspace-backend
container_name: crewspace-backend
restart: unless-stopped
env_file:
- .env
environment:
TZ: Asia/Seoul
volumes:
- ./data:/app/data
ports:
- "${HOST_BACKEND_PORT:-8000}:8000"
depends_on:
postgres:
condition: service_healthy
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
image: crewspace-frontend
container_name: crewspace-frontend
restart: unless-stopped
environment:
TZ: Asia/Seoul
ports:
- "${HOST_FRONTEND_PORT:-3000}:80"
depends_on:
- backend
volumes:
crewspace_pgdata:
name: crewspace_pgdata