Repository navigation
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
112 lines (103 loc) · 2.1 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
112 lines (103 loc) · 2.1 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
version: '3'
services:
postgres:
image: postgres:alpine
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=realworld
- PGDATA=/var/lib/postgresql/data/pgdata
ports:
- 5432:5432
volumes:
- postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 1s
timeout: 1s
retries: 10
adminer:
image: adminer
restart: always
ports:
- 8081:8080
depends_on:
postgres:
condition: service_healthy
mongo:
image: mongo
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: root
ports:
- 27017:27017
volumes:
- mongo:/data/db
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 1s
timeout: 1s
retries: 10
# apps
restful:
build:
context: .
dockerfile: Dockerfile
ports:
- 5000:5000
env_file:
- .env.docker
depends_on:
postgres:
condition: service_healthy
command: ["/app/main", "server"]
profiles:
- restful_postgres
restful_mongo:
build:
context: .
dockerfile: Dockerfile
ports:
- 5002:5000
env_file:
- .env.docker
depends_on:
mongo:
condition: service_healthy
command: ["/app/main", "server", "-d", "mongo"]
profiles:
- restful_mongo
grpc:
build:
context: .
dockerfile: Dockerfile
ports:
- 5001:5000
env_file:
- .env.docker
depends_on:
postgres:
condition: service_healthy
command: ["/app/main", "server", "-s", "grpc"]
profiles:
- grpc
- grpc_postgres
grpc_mongo:
build:
context: .
dockerfile: Dockerfile
ports:
- 5001:5000
env_file:
- .env.docker
depends_on:
postgres:
condition: service_healthy
command: ["/app/main", "server", "-s", "grpc", "-d", "mongo"]
profiles:
- grpc_mongo
volumes:
postgres:
mongo: