-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
52 lines (48 loc) · 1.38 KB
/
docker-compose.yml
File metadata and controls
52 lines (48 loc) · 1.38 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
version: '3.7'
services:
conf_service:
build: ./service
command: python -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
volumes:
- .:/service/app/
ports:
- 8001:8000
environment:
- POSTGRES_USER=conf_db_username
- POSTGRES_PASSWORD=conf_db_password
- POSTGRES_DB=conf_db_dev
#test db name is "test". If you want to change this name, you need to update the
#init.sql file also, in the postgres folder, and the db.py file
- POSTGRES_DB_T=test
depends_on:
conf_db:
condition: service_healthy
conf_db:
image: postgres:12.1-alpine
volumes:
- postgres_data_conf:/var/lib/postgresql/data/
- ./postgres_scripts/init.sql:/docker-entrypoint-initdb.d/init.sql
environment:
- POSTGRES_USER=conf_db_username
- POSTGRES_PASSWORD=conf_db_password
- POSTGRES_DB=conf_db_dev
ports:
- "5432:5432"
expose:
- 5432
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ]
interval: 3s
timeout: 10s
retries: 3
# in case of need, we could use nginx server for performance
# nginx:
# image: nginx:latest
# ports:
# - "8080:8080"
# volumes:
# - ./nginx_config.conf:/etc/nginx/conf.d/default.conf
# depends_on:
# - conf_service
volumes:
postgres_data_conf: