Files
RadioStore/docker-compose.yml
2026-05-05 20:56:06 +03:00

37 lines
1.1 KiB
YAML

# RadioStore — compile backend (Swift/Vapor) and admin panel (Vite/React) in containers.
#
# Prerequisites: Docker with Compose v2+.
#
# Usage (repo root):
# docker compose --profile compile run --rm backend-compile
# docker compose --profile compile run --rm admin-compile
#
# Or both:
# ./scripts/docker-compile-all.sh
#
# Optional: `.env` in repo root (see `.env.example`) sets `VITE_ADMIN_API_BASE_URL` for the admin build.
#
# Notes:
# - First `backend-compile` run pulls `swift:5.10-jammy` (large image).
# - Release binary path follows SPM layout (inside `./backend/.build`, varies by platform triple).
# - Admin output is always `./admin-web/dist/`.
services:
backend-compile:
image: swift:5.10-jammy
profiles: [compile]
working_dir: /src
volumes:
- ./backend:/src
command: ["swift", "build", "-c", "release", "--product", "Run"]
admin-compile:
image: node:20-bookworm-slim
profiles: [compile]
working_dir: /app
volumes:
- ./admin-web:/app
environment:
VITE_ADMIN_API_BASE_URL: ${VITE_ADMIN_API_BASE_URL:-http://localhost:8080}
command: ["sh", "-c", "npm install && npm run build"]