mancala/apps/compose.yaml
Halit Aksoy e165b0a0eb build: use local mancala.js and @mancala/core packages
- Apps and @mancala/core depend on the packages in this repo through
  link: dependencies instead of the npm releases, so changes no longer
  need a publish
- Root package.json gets a build:packages script that installs and
  builds both packages
- Backend and frontend Docker images are built from the repo root so
  they can include the packages; compose builds them that way
- Metro watches the packages folder and resolves their imports from the
  app's node_modules
2026-10-14 02:09:05 +03:00

58 lines
2.0 KiB
YAML

services:
backend:
image: jhalitaksoy/mancala-backend:latest
build:
context: ..
dockerfile: apps/backend/Dockerfile
environment:
# Must match the iss claim, i.e. the public Keycloak URL; https://auth.playmancala.app/realms/mancala in production
KEYCLOAK_ISSUER: ${KEYCLOAK_HOSTNAME:-http://localhost:8080}/realms/mancala
# Fetch keys over the compose network instead of the public URL
KEYCLOAK_JWKS_URL: http://keycloak:8080/realms/mancala/protocol/openid-connect/certs
KEYCLOAK_CLIENT_IDS: mancala-web
LEGACY_USERKEY_AUTH: ${LEGACY_USERKEY_AUTH:-true}
ports:
- "5000:6000"
frontend:
image: jhalitaksoy/mancala-frontend:latest
build:
context: ..
dockerfile: apps/frontend/Dockerfile
ports:
- "3000:3000"
keycloak-db:
image: postgres:17.6
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: ${KEYCLOAK_DB_PASSWORD:?set KEYCLOAK_DB_PASSWORD in apps/.env}
volumes:
- keycloak-db:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U keycloak -d keycloak"]
interval: 5s
timeout: 5s
retries: 10
keycloak:
image: jhalitaksoy/mancala-keycloak:latest
build: ./keycloak
environment:
KC_DB_URL: jdbc:postgresql://keycloak-db:5432/keycloak
KC_DB_USERNAME: keycloak
KC_DB_PASSWORD: ${KEYCLOAK_DB_PASSWORD}
# Public URL of Keycloak; https://auth.playmancala.app in production
KC_HOSTNAME: ${KEYCLOAK_HOSTNAME:-http://localhost:8080}
KC_HTTP_ENABLED: "true"
KC_PROXY_HEADERS: xforwarded
# Only used to create the master admin on the very first start
KC_BOOTSTRAP_ADMIN_USERNAME: ${KEYCLOAK_ADMIN_USERNAME:-admin}
KC_BOOTSTRAP_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:?set KEYCLOAK_ADMIN_PASSWORD in apps/.env}
ports:
- "127.0.0.1:8080:8080"
depends_on:
keycloak-db:
condition: service_healthy
volumes:
keycloak-db: