-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
171 lines (165 loc) · 3.84 KB
/
Copy pathdocker-compose.yml
File metadata and controls
171 lines (165 loc) · 3.84 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: prooflink
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-prooflink_dev}
POSTGRES_DB: prooflink
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U prooflink"]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
cpus: "1"
memory: 1G
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
networks:
- prooflink
redis:
image: redis:7-alpine
restart: unless-stopped
command: redis-server --maxmemory 256mb --maxmemory-policy allkeys-lru
ports:
- "${REDIS_PORT:-6379}:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
cpus: "0.5"
memory: 256M
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
networks:
- prooflink
api:
build:
context: .
dockerfile: Dockerfile
target: production
restart: unless-stopped
ports:
- "${API_PORT:-3001}:3001"
env_file:
- path: .env
required: false
environment:
DATABASE_URL: postgresql://prooflink:${POSTGRES_PASSWORD:-prooflink_dev}@postgres:5432/prooflink
REDIS_URL: redis://redis:6379
NODE_ENV: production
PORT: "3001"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3001/health"]
interval: 30s
timeout: 5s
start_period: 15s
retries: 3
deploy:
resources:
limits:
cpus: "2"
memory: 1G
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
networks:
- prooflink
api-dev:
profiles: ["dev"]
build:
context: .
dockerfile: Dockerfile
target: builder
command: ["pnpm", "--filter=@prooflink/api", "dev"]
ports:
- "${API_PORT:-3001}:3001"
env_file:
- path: .env
required: false
environment:
DATABASE_URL: postgresql://prooflink:${POSTGRES_PASSWORD:-prooflink_dev}@postgres:5432/prooflink
REDIS_URL: redis://redis:6379
NODE_ENV: development
volumes:
- ./packages/shared/src:/app/packages/shared/src
- ./packages/core/src:/app/packages/core/src
- ./packages/sdk/src:/app/packages/sdk/src
- ./apps/api/src:/app/apps/api/src
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
deploy:
resources:
limits:
cpus: "2"
memory: 1G
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
networks:
- prooflink
dashboard:
profiles: ["dev"]
build:
context: .
dockerfile: Dockerfile
target: builder
command: ["pnpm", "--filter=@prooflink/dashboard", "dev"]
ports:
- "${DASHBOARD_PORT:-3100}:3100"
volumes:
- ./apps/dashboard/src:/app/apps/dashboard/src
- ./apps/dashboard/public:/app/apps/dashboard/public
environment:
NEXT_PUBLIC_API_URL: http://localhost:${API_PORT:-3001}
depends_on:
- api-dev
deploy:
resources:
limits:
cpus: "1"
memory: 512M
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
networks:
- prooflink
volumes:
postgres_data:
redis_data:
networks:
prooflink:
driver: bridge