-
-
Save globax89/f3d09486c93ee101485b4df8e0249230 to your computer and use it in GitHub Desktop.
DRF project docker-compose.yml
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' | |
| services: | |
| web_app_db: | |
| restart: always | |
| container_name: web-app-db | |
| image: postgres:11 | |
| environment: | |
| - POSTGRES_USER=${POSTGRES_USER} | |
| - POSTGRES_NAME=${POSTGRES_NAME} | |
| - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} | |
| ports: | |
| - "${POSTGRES_LOCAL_PORT}:${POSTGRES_PORT}" | |
| healthcheck: | |
| test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_NAME}"] | |
| interval: 5s | |
| timeout: 5s | |
| retries: 5 | |
| django_backend: | |
| container_name: django-backend | |
| build: | |
| context: . | |
| dockerfile: DockerFile | |
| entrypoint: /entrypoint.sh | |
| command: bash -c "python manage.py runserver 0.0.0.0:${DJANGO_PORT}" | |
| ports: | |
| - "${DJANGO_PORT}:${DJANGO_PORT}" | |
| volumes: | |
| - .:/django_project | |
| depends_on: | |
| web_app_db: | |
| condition: service_healthy | |
| restart: on-failure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment