-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
102 lines (98 loc) · 2.2 KB
/
docker-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
services:
app-dev:
container_name: myapp_nest_dev
build:
context: .
dockerfile: Dockerfile
target: dev
image: myapp_nest_dev
pull_policy: build
restart: unless-stopped
ports:
- 3000:3000
depends_on:
database:
condition: service_healthy
restart: true
minio-s3:
condition: service_healthy
# redis:
# condition: service_healthy
command: pnpm start:dev
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
profiles:
- dev
app-prod:
container_name: myapp_nest_prod
build:
context: .
dockerfile: Dockerfile
target: prod
image: url-shortener
pull_policy: build
restart: always
ports:
- 3000:3000
profiles:
- prod
database:
container_name: database
image: postgres:16.3-alpine3.20
restart: always
environment:
POSTGRES_PASSWORD: pgpassword
POSTGRES_USER: pguser
POSTGRES_DB: pgdatabase
healthcheck:
test: ['CMD', 'pg_isready', '-q', '-U', 'pguser', '-d', 'pgdatabase']
start_period: 15s
interval: 10s
timeout: 10s
retries: 5
volumes:
- .pgdata:/var/lib/postgresql
ports:
- 5432:5432
profiles:
- dev
redis:
container_name: redis
image: redis:7.4.0-alpine3.20
restart: always
ports:
- 6379:6379
command: redis-server /usr/local/etc/redis/redis.conf
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 10s
timeout: 10s
retries: 5
volumes:
- .rddata:/data
- ./redis.conf:/usr/local/etc/redis/redis.conf
profiles:
- redis
minio-s3:
platform: linux/amd64
image: minio/minio:RELEASE.2024-08-03T04-33-23Z
container_name: minio-s3
ports:
- 9000:9000
- 9001:9001
environment:
MINIO_REGION: us-east-1
MINIO_REGION_NAME: us-east-1
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: miniostorage
command: server /data/minio --console-address :9001
healthcheck:
test: ['CMD', 'mc', 'ready', 'local']
interval: 10s
timeout: 10s
retries: 5
volumes:
- .minio_data/:/data
profiles:
- dev