# Demo stack: SPA + API + Postgres (internal) + pgAdmin. # Ports from env / build.ps1: # MYOFFICE_WEB_PORT (32080), MYOFFICE_API_PORT (32081), MYOFFICE_PGADMIN_PORT (32082) name: myoffice-demo services: postgres: image: postgres:17 container_name: myoffice-postgres restart: unless-stopped environment: POSTGRES_DB: myoffice POSTGRES_USER: myoffice POSTGRES_PASSWORD: myoffice volumes: # Host path (next to this compose file): ./data/demo/postgres - ./data/demo/postgres:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U myoffice -d myoffice"] interval: 5s timeout: 5s retries: 12 networks: - myoffice pgadmin: image: dpage/pgadmin4:9 container_name: myoffice-pgadmin restart: unless-stopped # Strip CRLF (Windows checkouts) then create pgpass (0600) and run image entrypoint. entrypoint: - /bin/sh - -c - sed 's/\r$//' /pgadmin-entrypoint.sh > /tmp/pgadmin-entrypoint.sh && exec /bin/sh /tmp/pgadmin-entrypoint.sh environment: PGADMIN_DEFAULT_EMAIL: admin@example.com PGADMIN_DEFAULT_PASSWORD: admin PGADMIN_CONFIG_SERVER_MODE: "False" PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: "False" ports: - "${MYOFFICE_PGADMIN_PORT:-32082}:80" volumes: # Host path: ./data/demo/pgadmin - ./data/demo/pgadmin:/var/lib/pgadmin - ./pgadmin/servers.json:/pgadmin4/servers.json:ro - ./pgadmin/entrypoint.sh:/pgadmin-entrypoint.sh:ro depends_on: postgres: condition: service_healthy networks: - myoffice api: build: context: .. dockerfile: Docker/Dockerfile.api image: myoffice-api:demo container_name: myoffice-api restart: unless-stopped ports: - "${MYOFFICE_API_PORT:-32081}:8080" environment: ASPNETCORE_ENVIRONMENT: Docker ASPNETCORE_URLS: http://+:8080 DatabaseProvider: npgsql ConnectionStrings__npgsql: Host=postgres;Port=5432;Database=myoffice;Username=myoffice;Password=myoffice FrontEnd__Host: ${MYOFFICE_FRONTEND_HOST:-http://localhost:32080} Cors__AllowedOrigins__0: ${MYOFFICE_CORS_0:-http://localhost:32080} Cors__AllowedOrigins__1: ${MYOFFICE_CORS_1:-http://127.0.0.1:32080} OpenIddict__UseEphemeralKeys: "true" OpenIddict__AllowHttp: "true" depends_on: postgres: condition: service_healthy networks: - myoffice web: build: context: .. dockerfile: Docker/Dockerfile.web args: API_PUBLIC_URL: ${MYOFFICE_API_PUBLIC_URL:-http://localhost:32081} image: myoffice-web:demo container_name: myoffice-web restart: unless-stopped ports: - "${MYOFFICE_WEB_PORT:-32080}:80" depends_on: - api networks: - myoffice networks: myoffice: driver: bridge