Created
June 5, 2022 16:11
-
-
Save Wittline/ec96d3a160595124d86f5d37582841e0 to your computer and use it in GitHub Desktop.
docker-compose file with "wait-for-it"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.1' | |
services: | |
db: | |
container_name: pg_container | |
image: postgres | |
restart: always | |
environment: | |
POSTGRES_USER: "postgres" | |
POSTGRES_PASSWORD: "pg12345" | |
POSTGRES_DB: "db" | |
POSTGRES_HOST_AUTH_METHOD: trust | |
ports: | |
- "5432:5432" | |
networks: | |
- postgres | |
ingestion: | |
build: ./ingestion/ | |
container_name: ingestion | |
networks: | |
- postgres | |
depends_on: | |
- db | |
command: bash -c "/usr/wait-for-it.sh --timeout=0 db:5432 && python -u ./app/main.py" | |
volumes: | |
- ./ingestion/app/data:/ingestion/app/data/:z | |
api: | |
build: ./api/ | |
container_name: api | |
ports: | |
- "8080:8080" | |
networks: | |
- postgres | |
depends_on: | |
- ingestion | |
networks: | |
postgres: | |
driver: bridge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment