-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
108 lines (99 loc) · 2.34 KB
/
Copy pathdocker-compose.yml
File metadata and controls
108 lines (99 loc) · 2.34 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
version: "3.9"
services:
server:
container_name: server_container
image: server:latest
build: server/
ports:
- "8000:8000"
expose:
- 8000
env_file:
- ./.env
depends_on:
- mongodb
- db
mongodb:
image: mongo:latest
container_name: mongo
env_file:
- ./.env
environment:
MONGO_USERNAME: ${MONGO_USERNAME}
MONGO_PASSWORD: ${MONGO_PASSWORD}
MONGO_DATABASE: ${MONGO_DATABASE}
volumes:
- mongo:/data/db
ports:
- '27017:27017'
expose:
- 27017
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
# if you want to interactive with CLI client then run the client image mannually with no docker compose:
# docker build -t client_image .
# docker run -it client_image
# client:
# container_name: client_container
# image: client:latest
# build: client/
# depends_on:
# - server
# ports:
# - "5555:5555"
# tty: true # docker run -t
# stdin_open: true # docker run -i
# network_mode: host # define that the container can access to the 'localhost' of the computer
# command: ["python", "./main.py", "-it"]
# client2:
# image: client:latest
# build: client/
# nginx:
# image: nginx:latest
# ports:
# - "8080:8080"
# volumes:
# - ./nginx_config.conf:/etc/nginx/conf.d/default.conf
# depends_on:
# - server
# - client
db:
container_name: postgres_container
image: postgres:15-alpine
restart: always
volumes:
- postgres_data:/var/lib/postgresql/data/
ports:
- 5432:5432
expose:
- 5432
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres_db
- POSTGRES_SERVER=db
env_file:
- ./.env
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
pgadmin:
image: dpage/pgadmin4
container_name: pgadmin_container
restart: always
ports:
- "5050:80"
environment:
PGADMIN_DEFAULT_EMAIL: adi.epshtain@gmail.com
PGADMIN_DEFAULT_PASSWORD: postgres
volumes:
- pgadmin-data:/var/lib/pgadmin
volumes:
mongo:
postgres_data:
pgadmin-data: