-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
123 lines (115 loc) · 3.39 KB
/
Copy pathdocker-compose.yml
File metadata and controls
123 lines (115 loc) · 3.39 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
version: '3.9'
x-common-env: &common-env
PULO_FARCASTER_MODE: ${PULO_FARCASTER_MODE:-mock}
LOG_LEVEL: ${LOG_LEVEL:-info}
NODE_ENV: ${NODE_ENV:-development}
x-common-volumes: &common-volumes
- ./..:/app
- /app/node_modules
services:
postgres:
image: postgres:16-alpine
container_name: pulo_postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-pulo}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-pulo_dev_password}
POSTGRES_DB: ${POSTGRES_DB:-pulo_dev}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./infra/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
ports:
- "${PULO_POSTGRES_PORT:-5432}:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-pulo} -d ${POSTGRES_DB:-pulo_dev}"]
interval: 3s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
container_name: pulo_redis
restart: unless-stopped
ports:
- "${PULO_REDIS_PORT:-6379}:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 3s
timeout: 5s
retries: 10
api:
build:
context: ../..
dockerfile: infra/docker/api.Dockerfile
container_name: pulo_api
restart: unless-stopped
environment:
<<: *common-env
DATABASE_URL: postgres://${POSTGRES_USER:-pulo}:${POSTGRES_PASSWORD:-pulo_dev_password}@postgres:5432/${POSTGRES_DB:-pulo_dev}
REDIS_URL: redis://redis:6379
PULO_API_PORT: ${PULO_API_PORT:-4311}
PULo_API_PORT: ${PULO_API_PORT:-4311}
ports:
- "${PULO_API_PORT:-4311}:4311"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:4311/health"]
interval: 5s
timeout: 5s
retries: 10
volumes:
- ./..:/app
- /app/node_modules
command: ["pnpm", "--filter", "@pulo/api", "dev"]
worker:
build:
context: ../..
dockerfile: infra/docker/worker.Dockerfile
container_name: pulo_worker
restart: unless-stopped
environment:
<<: *common-env
DATABASE_URL: postgres://${POSTGRES_USER:-pulo}:${POSTGRES_PASSWORD:-pulo_dev_password}@postgres:5432/${POSTGRES_DB:-pulo_dev}
REDIS_URL: redis://redis:6379
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "node", "-e", "const http=require('http');http.get('http://localhost:4321/health',r=>process.exit(r.statusCode===200?0:1)).on('error',()=>process.exit(1))"]
interval: 5s
timeout: 5s
retries: 10
volumes:
- ./..:/app
- /app/node_modules
command: ["pnpm", "--filter", "@pulo/worker", "dev"]
web:
build:
context: ../..
dockerfile: infra/docker/web.Dockerfile
container_name: pulo_web
restart: unless-stopped
environment:
<<: *common-env
NEXT_PUBLIC_API_URL: http://localhost:${PULO_API_PORT:-4311}
ports:
- "${PULO_WEB_PORT:-3000}:3000"
depends_on:
- api
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000"]
interval: 5s
timeout: 5s
retries: 10
volumes:
- ./..:/app
- /app/node_modules
- /app/apps/web/.next
command: ["pnpm", "--filter", "@pulo/web", "dev"]
volumes:
postgres_data: