Files
2026-04-29 14:46:41 +03:00

69 lines
1.6 KiB
YAML

services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: rostpoliplast
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
rabbitmq:
image: rabbitmq:3-management-alpine
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
ports:
- "5672:5672"
- "15672:15672"
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
interval: 10s
timeout: 10s
retries: 5
app:
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080"
environment:
DATABASE_URL: postgres://postgres:postgres@postgres:5432/rostpoliplast?sslmode=disable
RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672/
depends_on:
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
volumes:
- ./migrations:/app/migrations
command: >
sh -c "
goose -dir=/app/migrations postgres 'postgres://postgres:postgres@postgres:5432/rostpoliplast?sslmode=disable' up &&
/server
"
scanner:
build:
context: ../scanner
dockerfile: Dockerfile
environment:
SERVER_URL: http://app:8080
depends_on:
app:
condition: service_started
devices:
- /dev/video0:/dev/video0
profiles:
- scanner
volumes:
postgres_data: