DAS_2024_1/zhimolostnova_anna_lab_3/docker-compose.yml

65 lines
1.5 KiB
YAML
Raw Normal View History

2024-10-05 22:14:57 +04:00
services:
# Общая база данных для обоих сервисов
postgres-db:
image: postgres:13-alpine
environment:
POSTGRES_USER: ${DB_USER} # Общий пользователь базы данных
POSTGRES_PASSWORD: ${DB_PASSWORD} # Пароль для базы данных
POSTGRES_DB: ${DB_STREAM_NAME} # База данных для сервиса Stream
ports:
- "5432:5432" # Порт базы данных
volumes:
- postgres-db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER}"]
interval: 20s
timeout: 20s
retries: 10
networks:
- network
# Сервис Stream
stream-service:
build: ./streamService
env_file:
- .env
networks:
- network
ports:
- "8000:8000"
depends_on:
postgres-db:
condition: service_healthy
# Сервис Message
message-service:
build: ./messageService
env_file:
- .env
networks:
- network
ports:
- "8080:8080"
depends_on:
postgres-db:
condition: service_healthy
nginx:
image: nginx
ports:
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
networks:
- network
depends_on:
- stream-service
- message-service
networks:
network:
driver: bridge
volumes:
postgres-db-data: