Created
September 17, 2023 18:27
-
-
Save borymskyi/d3159c3d6f1afccb913495f79e08818e to your computer and use it in GitHub Desktop.
winwin-comment-docker-compose-example
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.8' | |
services: | |
db: | |
image: postgres | |
container_name: "db" | |
volumes: | |
- pg_data:/var/lib/postgresql/data | |
environment: | |
POSTGRES_USER: ${DB_USERNAME} | |
POSTGRES_PASSWORD: ${DB_USERNAME} | |
POSTGRES_DB: ${POSTGRES_DB_NAME} | |
ports: | |
- ${EXTERNAL_DB_PORT}:5432 | |
healthcheck: | |
test: [ "CMD-SHELL", "pg_isready -U ${DB_USERNAME} -d winwin" ] | |
interval: 8s | |
timeout: 4s | |
retries: 4 | |
networks: | |
- winwin | |
# app: | |
# build: | |
# context: . | |
# dockerfile: Dockerfile | |
# environment: | |
# - APP_PORT=${APP_PORT} | |
# - EXTERNAL_DB_PORT=${EXTERNAL_DB_PORT} | |
# - POSTGRES_DB_NAME=${POSTGRES_DB_NAME} | |
# - DB_USERNAME=${DB_USERNAME} | |
# - DB_PASSWORD=${DB_PASSWORD} | |
# - DB_HOST=db | |
# ports: | |
# - ${APP_PORT}:${APP_PORT} | |
# depends_on: | |
# - db | |
# networks: | |
# - winwin | |
volumes: | |
pg_data: | |
networks: | |
winwin: | |
driver: bridge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment