Last active
August 7, 2019 11:44
-
-
Save kerren/40477bea0fea2c47cdf0798a17cc4f9f to your computer and use it in GitHub Desktop.
The Docker Compose file that waits for migration
This file contains hidden or 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.6' | |
services: | |
database: | |
image: postgres | |
environment: | |
- POSTGRES_PASSWORD=testing | |
- POSTGRES_USER=testing | |
- POSTGRES_DB=testing | |
ports: | |
- 5432 | |
expose: | |
- 5432 | |
networks: | |
- testing-network | |
redis: | |
image: redis | |
ports: | |
- 6379 | |
expose: | |
- 6379 | |
networks: | |
- testing-network | |
migration: | |
build: | |
context: ../../../backend/ | |
dockerfile: $PWD/Dockerfile.migration | |
ports: | |
- 3000 | |
environment: | |
- DB_USERNAME=testing | |
- DB_PASSWORD=testing | |
- DB_DATABASE=testing | |
- DB_HOST=database | |
- REDIS_HOST=redis | |
- WAIT_HOSTS: database:3306, redis:6379 | |
- WAIT_HOSTS_TIMEOUT: 300 | |
depends_on: | |
- database | |
- redis | |
networks: | |
- testing-network | |
backend: | |
build: | |
context: ../../../backend/ | |
dockerfile: $PWD/Dockerfile | |
ports: | |
- 3000 | |
environment: | |
- DB_USERNAME=testing | |
- DB_PASSWORD=testing | |
- DB_DATABASE=testing | |
- DB_HOST=database | |
- REDIS_HOST=redis | |
- WAIT_HOSTS: migration:3000 | |
- WAIT_HOSTS_TIMEOUT: 300 | |
depends_on: | |
- migration | |
networks: | |
- testing-network | |
networks: | |
testing-network |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment