Created
February 27, 2023 00:11
-
-
Save Cosikowy/042b9f8c3172ca90317c3211dd90e834 to your computer and use it in GitHub Desktop.
Docker-compose + django - wait for db to be up then start django server
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
services: | |
app: | |
build: | |
dockerfile: dockerfile | |
context: . | |
ports: | |
- 8000:8000 | |
entrypoint: python manage.py runserver 0.0.0.0:8000 | |
env_file: .env | |
volumes: | |
- ./:/app/ | |
depends_on: | |
db: | |
condition: service_healthy | |
db: | |
image: postgres:15.2 | |
ports: | |
- 5432:5432 | |
env_file: .env | |
healthcheck: | |
test: [ "CMD-SHELL", "pg_isready -U postgres" ] | |
interval: 5s | |
timeout: 5s | |
retries: 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment