-
Notifications
You must be signed in to change notification settings - Fork 17
/
compose.yml
118 lines (108 loc) · 2.77 KB
/
compose.yml
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
x-defaults: &defaults
restart: always
init: true
env_file:
- .env
environment: &environment
DOCKER: true
REDIS_HOST: redis
REDIS_PORT: 6379
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
logging:
driver: 'json-file'
options:
max-size: '5m'
max-file: '10'
tag: '{{.Name}}'
healthcheck: &healthcheck
interval: 15s
timeout: 7s
retries: 3
start_period: 10s
x-base: &base
build: .
user: node
services:
postgres:
<<: *defaults
image: postgres:15.4-alpine
ports:
- 5432:5432
volumes:
- postgres:/var/lib/postgresql/data
healthcheck:
<<: *healthcheck
test: ['CMD', 'nc', '-zv', 'localhost', '5432']
redis:
<<: *defaults
image: redis:7.2-alpine
ports:
- 6379:6379
volumes:
- redis:/data
healthcheck:
<<: *healthcheck
test: ['CMD', 'nc', '-zv', 'localhost', '6379']
cdn:
<<: *defaults
image: nginx:latest
ports:
- 8080:80
volumes:
- ./docker/cdn/nginx.conf:/etc/nginx/nginx.conf
- cdn:/var/www/cdn
healthcheck:
<<: *healthcheck
test: ['CMD', 'nc', '-zv', 'localhost', '80']
api:
<<: [*defaults, *base]
command: pnpm turbo run dev --env-mode=loose --filter='@blms/api'
ports:
- 3000:3000
environment:
HOST: 0.0.0.0
REDIS_HOST: redis
POSTGRES_HOST: postgres
volumes:
- ./apps/api:/home/node/apps/api
- /home/node/apps/api/node_modules/
- ./packages/service-content/src:/home/node/packages/service-content/src
- ./packages/database/src:/home/node/packages/database/src
- ./packages/schemas/src:/home/node/packages/schemas/src
- ./packages/redis/src:/home/node/packages/redis/src
- ./packages/types/src:/home/node/packages/types/src
- ./packages/service-user/src:/home/node/packages/service-user/src
- cdn:$CDN_PATH
- sync:${SYNC_PATH:-/tmp/sync}
- ${OTS_PGP_KEY_PATH:-./key.asc}:/tmp/key.asc:ro
depends_on:
- postgres
- redis
healthcheck:
<<: *healthcheck
test: ['CMD', 'nc', '-zv', 'localhost', '3000']
web:
<<: [*defaults, *base]
command: pnpm turbo run dev --env-mode=loose --filter='@blms/web'
ports:
- 8181:8181
volumes:
- ./apps/web:/home/node/apps/web
- /home/node/apps/web/node_modules/
- ./packages/ui/src:/home/node/packages/ui/src
- ./packages/database/src:/home/node/packages/database/src
- ./packages/schemas/src:/home/node/packages/schemas/src
- ./packages/types/src:/home/node/packages/types/src
- cdn:$CDN_PATH
depends_on:
- api
healthcheck:
<<: *healthcheck
test: ['CMD', 'nc', '-zv', 'localhost', '8181']
volumes:
corestore:
postgres:
redis:
cdn:
sync: