-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
46 lines (42 loc) · 986 Bytes
/
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
version: "3.9"
name: data-challenge-latch
x-common-env-vars:
&common-env-vars
env_file:
- ./.env
services:
postgres:
<<: *common-env-vars
container_name: postgres
hostname: postgres
image: postgres:${POSTGRES_VERSION:-14.7}
ports:
- ${POSTGRES_EXT_PORT:-5440}:${POSTGRES_PORT:-5432}
restart: unless-stopped
volumes:
- ./scripts/postgres_init.sh:/docker-entrypoint-initdb.d/postgres_init.sh
healthcheck:
test:
[
"CMD",
"pg_isready",
"-U",
"${POSTGRES_USER}",
"-d",
"${POSTGRES_DB}"
]
interval: 10s
timeout: 5s
retries: 5
load-data:
<<: *common-env-vars
container_name: load-data
build:
context: .
dockerfile: ./Dockerfile
working_dir: /code
command: poetry run python3 -q data-challenge_sfrpt/loader.py
restart: on-failure
depends_on:
postgres:
condition: service_healthy