36 lines
911 B
YAML
36 lines
911 B
YAML
|
version: '2.1'
|
||
|
|
||
|
services:
|
||
|
postgres:
|
||
|
image: postgres:13
|
||
|
environment:
|
||
|
- POSTGRES_USER=postgres
|
||
|
- POSTGRES_PASSWORD=postgres
|
||
|
- POSTGRES_DB=lunatech_covid
|
||
|
ports:
|
||
|
- "5432:5432"
|
||
|
networks:
|
||
|
- default
|
||
|
healthcheck:
|
||
|
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
|
||
|
interval: 10s
|
||
|
timeout: 5s
|
||
|
retries: 5
|
||
|
logging:
|
||
|
driver: none
|
||
|
|
||
|
postgres-init:
|
||
|
image: postgres:13
|
||
|
depends_on:
|
||
|
postgres:
|
||
|
condition: service_healthy
|
||
|
environment:
|
||
|
- PGPASSWORD=postgres
|
||
|
volumes:
|
||
|
- ./database-init/initialize-db.sh:/initialize-db.sh
|
||
|
- ./database-init/schema.sql:/schema.sql
|
||
|
- ./database-init/cases.csv:/cases.csv
|
||
|
- ./database-init/countries.csv:/countries.csv
|
||
|
- ./database-init/vaccinations.csv:/vaccinations.csv
|
||
|
command: bash -c "sleep 10 && chmod u+x /initialize-db.sh && /initialize-db.sh"
|