generated from jarvis394/nestjs-prisma-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.dev.yml
115 lines (107 loc) · 2.25 KB
/
docker-compose.dev.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
x-defaults: &defaults
init: true
tty: true
logging:
driver: 'json-file'
options:
max-size: '20m'
max-file: '3'
networks:
- valley_network
# Settings and configurations that are common for all containers
x-minio-common: &minio-common
image: minio/minio
command: server --console-address ":9001" /data/minio
expose:
- '9000'
- '9001'
env_file:
- .env
healthcheck:
test: ['CMD', 'mc', 'ready', 'local']
interval: 5s
timeout: 5s
retries: 5
logging:
driver: 'json-file'
options:
max-size: '20m'
max-file: '3'
init: true
tty: true
networks:
- valley_network
name: valley
services:
minio:
<<: *minio-common
hostname: minio
volumes:
- data:/data
postgres:
<<: *defaults
container_name: valley-postgres
image: postgres:16-alpine
env_file:
- .env
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- postgres-data:/var/lib/postgresql/data
- ./postgres:/docker-entrypoint-initdb.d
ports:
- '5432:5432'
restart: always
healthcheck:
test: ['CMD', 'pg_isready -d valley -U ${DB_USER}']
interval: 5s
timeout: 5s
retries: 10
redis:
<<: *defaults
container_name: valley-redis
image: redis:latest
env_file:
- .env
restart: always
ports:
- '6379:6379'
volumes:
- redis-data:/data
environment:
- REDIS_PORT=6379
- REDIS_DATABASES=16
nginx:
<<: *defaults
image: nginx:1.19.2-alpine
hostname: nginx
volumes:
- ./nginx/nginx-dev.conf:/etc/nginx/nginx.conf:ro
ports:
- '9000:9000'
- '9001:9001'
depends_on:
- minio
# Creates minio bucket on startup if it was not created before
createbuckets:
<<: *defaults
image: minio/mc:latest
env_file:
- .env
depends_on:
- minio
- nginx
entrypoint: >
/bin/sh -c "
/usr/bin/mc config host add myminio http://nginx:9000 ${MINIO_ROOT_USER} ${MINIO_ROOT_PASSWORD};
/usr/bin/mc mb myminio/${AWS_BUCKET};
/usr/bin/mc anonymous set private myminio/${AWS_BUCKET};
exit 0;
"
volumes:
data:
redis-data:
postgres-data:
networks:
valley_network: