Files
kmtnflower/docker-compose.yml
T

79 lines
2.2 KiB
YAML

services:
db:
image: docker.io/library/postgres:16-alpine
restart: unless-stopped
# NOTE: Change POSTGRES_PASSWORD in production. Consider using Docker secrets or
# a managed PostgreSQL service instead of local credentials.
environment:
POSTGRES_DB: kmountain
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- pgdata:/var/lib/postgresql/data
- pgsocket:/var/run/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
# NOTE: Update KMTN_CORS_ORIGINS in production to your actual domain(s).
# Set KMTN_DATABASE_URL to your managed PostgreSQL connection if not using the local db service.
api:
build:
context: ./backend
dockerfile: Dockerfile
restart: unless-stopped
environment:
KMTN_DATABASE_URL: >-
postgresql+asyncpg://postgres:postgres@/kmountain?host=/var/run/postgresql
KMTN_CORS_ORIGINS: '["http://localhost:4200", "http://localhost"]'
KMTN_ADMIN_USERNAME : "admin"
KMTN_ADMIN_PASSWORD : "123"
KMTN_STATIC_UPSTREAM_URL: http://frontend:80
volumes:
- pgsocket:/var/run/postgresql
- logs:/logs
depends_on:
db:
condition: service_healthy
frontend:
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
environment:
API_UPSTREAM: http://api:8000
API_PUBLIC_URL: ""
ports:
- "4200:80"
volumes:
- logs:/logs
depends_on:
- api
# Flutter build container — runs alongside the api/frontend services.
# The api container SSHes directly into this container over the Docker network.
# Forced to linux/amd64 because Android SDK CLI tools are only published
# for x86_64. On Apple Silicon hosts, Docker runs via Rosetta emulation.
build:
build:
context: ./build
dockerfile: Dockerfile
platform: linux/amd64
restart: unless-stopped
mem_limit: 16g
mem_reservation: 8g
expose:
- "22"
volumes:
- flutter-cache:/home/vscode/.pub-cache
- android-licenses:/opt/android-sdk/licenses
volumes:
pgdata:
pgsocket:
logs:
flutter-cache:
android-licenses: