Files
demo-decoupled/docker-compose.yml
Liosha84andClaude Opus 5.5 48ac16bb2f fix(compose): limit frontend memory to 64m
On Jambotron the project memory budget is split equally between services
without their own limit, so nginx got 341 MB while the backend was at 80%
of its share. With 64m for the frontend the backend and the database get
about 480 MB each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 22:49:52 +02:00

62 lines
2.2 KiB
YAML
Raw Permalink 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:
demo-decoupled-postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: jambotron_decoupled
POSTGRES_USER: jambotron_admin
POSTGRES_PASSWORD: jambo_secret_pass
healthcheck:
test: ["CMD-SHELL", "pg_isready -U jambotron_admin -d jambotron_decoupled"]
interval: 3s
timeout: 3s
retries: 5
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- demo-decoupled
backend:
build: .
# Собирать образ при каждом `docker compose up`, иначе compose молча запускает старый образ
pull_policy: build
restart: unless-stopped
# Ждём, пока база начнёт принимать подключения, иначе Flyway падает на старте
depends_on:
demo-decoupled-postgres:
condition: service_healthy
ports:
- "8080:8080"
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://demo-decoupled-postgres:5432/jambotron_decoupled?options=-c%20timezone=UTC
SPRING_DATASOURCE_USERNAME: jambotron_admin
SPRING_DATASOURCE_PASSWORD: jambo_secret_pass
# В application.yaml Flyway настроен на localhost отдельно от datasource — переопределяем
SPRING_FLYWAY_URL: jdbc:postgresql://demo-decoupled-postgres:5432/jambotron_decoupled?options=-c%20timezone=UTC
SPRING_FLYWAY_USER: jambotron_admin
SPRING_FLYWAY_PASSWORD: jambo_secret_pass
networks:
- demo-decoupled
frontend:
build: ./spring-angular-ui
pull_policy: build
restart: unless-stopped
# nginx проксирует /api на backend — без него UI не работает
depends_on:
backend:
condition: service_healthy
ports:
- "8081:80"
# nginx со статикой хватает 64 МБ. На Jambotron бюджет памяти проекта делится поровну между
# сервисами без своего лимита — так backend и база получат больше
mem_limit: 64m
networks:
- demo-decoupled
volumes:
postgres_data:
networks:
demo-decoupled: