Initial commit
Made-with: Cursor
This commit is contained in:
112
docker-compose.yml
Normal file
112
docker-compose.yml
Normal file
@@ -0,0 +1,112 @@
|
||||
services:
|
||||
|
||||
db:
|
||||
image: timescale/timescaledb:latest-pg16
|
||||
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:10
|
||||
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_user}
|
||||
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:
|
||||
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/pubapi/v1/market-data/dam}
|
||||
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_user}
|
||||
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
|
||||
Reference in New Issue
Block a user