Files
ems/docker-compose.yml
Dusan Vojacek c11ce83a97
Some checks failed
deploy / deploy (push) Successful in 18s
test / smoke-test (push) Has been cancelled
update flyway 10->12
2026-04-05 11:53:02 +02:00

114 lines
3.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
services:
db:
image: timescale/timescaledb:2.26.1-pg18
restart: unless-stopped
environment:
POSTGRES_DB: ems
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- db_data:/var/lib/postgresql/data
ports:
- "127.0.0.1:5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ems"]
interval: 10s
timeout: 5s
retries: 5
flyway:
image: flyway/flyway:12
depends_on:
db:
condition: service_healthy
environment:
FLYWAY_URL: jdbc:postgresql://db:5432/ems
FLYWAY_USER: ${DB_USER}
FLYWAY_PASSWORD: ${DB_PASSWORD}
FLYWAY_SCHEMAS: ems
FLYWAY_LOCATIONS: filesystem:/flyway/sql/migration,filesystem:/flyway/sql/routines,filesystem:/flyway/sql/views
FLYWAY_BASELINE_ON_MIGRATE: "false"
command: migrate
volumes:
- ./db/migration:/flyway/sql/migration
- ./db/routines:/flyway/sql/routines
- ./db/views:/flyway/sql/views
postgrest:
image: postgrest/postgrest:v12.2.3
restart: unless-stopped
depends_on:
db:
condition: service_healthy
flyway:
condition: service_completed_successfully
environment:
PGRST_DB_URI: postgres://${DB_USER}:${DB_PASSWORD}@db:5432/ems
PGRST_DB_SCHEMA: ems
PGRST_DB_EXTRA_SEARCH_PATH: ems
PGRST_DB_ANON_ROLE: ${POSTGREST_ANON_ROLE:-ems_anon}
PGRST_JWT_SECRET: ${POSTGREST_JWT_SECRET}
PGRST_SERVER_PORT: 3000
PGRST_OPENAPI_SERVER_PROXY_URI: http://localhost/rest
ports:
- "127.0.0.1:3000:3000"
backend:
build: ./backend
restart: unless-stopped
depends_on:
db:
condition: service_healthy
flyway:
condition: service_completed_successfully
env_file:
- .env
environment:
TZ: Europe/Prague
DB_HOST: db
DB_PORT: "5432"
POSTGRES_HOST: db
POSTGRES_PORT: "5432"
DB_NAME: ems
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
OTE_API_URL: ${OTE_API_URL:-https://www.ote-cr.cz/cs/kratkodobe-trhy/elektrina/denni-trh/@@chart-data}
EUR_CZK_RATE: ${EUR_CZK_RATE:-25.0}
OPEN_METEO_API_URL: ${OPEN_METEO_API_URL:-https://api.open-meteo.com/v1/forecast}
TELEMETRY_POLL_INTERVAL_SEC: ${TELEMETRY_POLL_INTERVAL_SEC:-60}
PLANNING_HORIZON_HOURS: ${PLANNING_HORIZON_HOURS:-36}
PLANNING_HP_MAX_COST_CZK_KWH: ${PLANNING_HP_MAX_COST_CZK_KWH:-3.0}
LOXONE_USER: ${LOXONE_USER:-}
LOXONE_PASSWORD: ${LOXONE_PASSWORD:-}
POSTGREST_JWT_SECRET: ${POSTGREST_JWT_SECRET}
POSTGREST_ANON_ROLE: ${POSTGREST_ANON_ROLE:-ems_anon}
ports:
- "127.0.0.1:8000:8000"
volumes:
- ./backend:/app
frontend:
build: ./frontend
restart: unless-stopped
ports:
- "80:80"
depends_on:
- backend
- postgrest
volumes:
db_data:
driver: local
# Explicitní podsíť vyhne se vyčerpání výchozích Docker address pools při mnoha projektech.
# Pokud 172.28.240.0/24 koliduje s jinou sítí, změň subnet/gateway.
networks:
default:
name: ems-cursor_net
driver: bridge
ipam:
config:
- subnet: 172.28.240.0/24
gateway: 172.28.240.1