-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
68 lines (62 loc) · 1.41 KB
/
docker-compose.yaml
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
services:
pgdatabase:
image: postgres:14
env_file:
- .env
environment:
- POSTGRES_USER=${DBUSER}
- POSTGRES_PASSWORD=${DBPASS}
- POSTGRES_DB=${DBNAME}
volumes:
- "./postgres_data:/var/lib/postgresql/data:rw"
ports:
- "${POSTGRES_PORT}:5432"
networks:
- db_network
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB" ]
interval: 10s
timeout: 10s
retries: 5
start_period: 30s
pgadmin:
image: dpage/pgadmin4
env_file:
- .env
environment:
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL}
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD}
volumes:
- "./pgadmin:/var/lib/pgadmin:rw"
ports:
- "${PGADMIN_PORT}:80"
networks:
- db_network
user: root
dl_data:
build:
context: .
dockerfile: Dockerfile
command: ["python", "dl_from_aws.py"]
networks:
- db_network
depends_on:
pgdatabase:
condition: service_healthy
restart: true
create_table:
condition: service_completed_successfully
create_table:
build:
context: .
dockerfile: Dockerfile
command: ["python", "create_table.py"]
networks:
- db_network
depends_on:
pgdatabase:
condition: service_healthy
restart: true
networks:
db_network:
name: db_network