services: postgres: image: postgres:16 environment: POSTGRES_DB: unlocked POSTGRES_USER: unlocked POSTGRES_PASSWORD: dev ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data - config:/docker-entrypoint-initdb.d healthcheck: test: ["CMD-SHELL", "pg_isready -U unlocked"] interval: 10s timeout: 5s retries: 5 networks: - intranet frontend: build: context: frontend dockerfile: dev.Dockerfile volumes: - ./frontend:/app - node_modules:/app/node_modules networks: - intranet rev_proxy: image: nginx:1.21.3-alpine ports: - 80:80 volumes: - ./config/dev.nginx.conf:/etc/nginx/conf.d/default.conf - logs:/var/log/nginx/ networks: - intranet restart: unless-stopped depends_on: kratos-migrate: condition: service_completed_successfully # backend API server: build: context: ./ dockerfile: backend/dev.Dockerfile ports: - 8080:8080 networks: - intranet volumes: - ./:/app - ./frontend/public/thumbnails:/imgs environment: - APP_DSN=postgres://unlocked:dev@postgres:5432/unlocked - APP_ENV=production - LOG_LEVEL=debug - APP_URL=http://127.0.0.1 - APP_KEY=base64:NTQxODNmNDMyM2YzNzdiNzM3NDMzYTFlOTgyMjllYWQwZmRjNjg2ZjkzYmFiMDU3ZWNiNjEyZGFhOTQwMDJiNSAgLQo= - PROVIDER_SERVICE_URL=http://provider-service:8081 - HYDRA_ADMIN_URL=http://hydra:4445 - HYDRA_PUBLIC_URL=http://hydra:4444 - KRATOS_ADMIN_URL=http://kratos:4434 - KRATOS_PUBLIC_URL=http://kratos:4433 - MIDDLEWARE_CRON_SCHEDULE=0 22 * * * - KETO_ADMIN_URL=http://keto:4466 - ORY_TOKEN=eyJvZmZzZXQiOiItMjUwIiwidmo8iV*@ - NATS_URL=nats:4222 - NATS_USER=unlocked - NATS_PASSWORD=dev - IMG_FILEPATH=/imgs - MIGRATION_DIR=backend/migrations depends_on: kratos: condition: service_started postgres: condition: service_healthy # Provider middleware provider-service: build: context: . dockerfile: provider-middleware/dev.Dockerfile environment: - APP_ENV=dev - DB_HOST=postgres - DB_PORT=5432 - DB_USER=unlocked - DB_PASSWORD=dev - KOLIBRI_DB_PASSWORD=dev - DB_NAME=unlocked - NATS_URL=nats:4222 - NATS_USER=unlocked - NATS_PASSWORD=dev - APP_URL=http://server:8080 - BRIGHTSPACE_TEMP_DIR=/csvs networks: - intranet volumes: - logs:/logs - ./frontend/public/videos:/videos - ./:/app - csvs:/csvs ports: - 8081:8081 restart: unless-stopped depends_on: [server] # Scheduler + task runner for provider-middleware cron-tasks: build: context: . dockerfile: ./backend/tasks/dev.Dockerfile environment: - LOG_LEVEL=debug - NATS_URL=nats:4222 - NATS_USER=unlocked - NATS_PASSWORD=dev - DB_HOST=postgres - DB_PORT=5432 - DB_USER=unlocked - DB_PASSWORD=dev - DB_NAME=unlocked - MIDDLEWARE_CRON_SCHEDULE=0 22 * * * networks: - intranet volumes: - logs:/logs - ./:/app depends_on: [provider-service] keto-migrate: image: oryd/keto:v0.12.0-alpha.0 links: - postgres:postgres volumes: - config:/home/ory environment: - LOG_LEVEL=debug - DSN=postgres://keto:ChangeMe!@postgres:5432/accesscontroldb?sslmode=prefer&max_conns=20&max_idle_conns=4 command: ["migrate", "up", "-y"] depends_on: postgres: condition: service_healthy networks: - intranet nats: image: nats:latest networks: - intranet ports: - 8222:8222 - 4222:4222 command: --js -c /config/nats-server.conf restart: on-failure volumes: - config:/config - nats_data:/data keto: image: oryd/keto:v0.11.1-alpha.0 links: - postgres:postgres volumes: - type: bind source: config target: /home/ory ports: - "4466:4466" - "4467:4467" depends_on: - keto-migrate environment: - DSN=postgres://keto:ChangeMe!@postgres:5432/accesscontroldb?sslmode=prefer&max_conns=20&max_idle_conns=4 networks: - intranet kratos-migrate: image: oryd/kratos:v1.1.0 environment: - DSN=postgres://kratos:ChangeMe!@postgres:5432/kratos?sslmode=disable&max_conns=20&max_idle_conns=4 volumes: - type: bind source: ./config/kratos target: /etc/config/kratos command: -c /etc/config/kratos/kratos.yml migrate sql -e --yes networks: - intranet depends_on: postgres: condition: service_healthy kratos: depends_on: - kratos-migrate image: oryd/kratos:v1.1.0 ports: - "4433:4433" # public - "4434:4434" # admin environment: - DSN=postgres://kratos:ChangeMe!@postgres:5432/kratos?sslmode=prefer&max_conns=20&max_idle_conns=4 - LOG_LEVEL=trace command: serve -c /etc/config/kratos/kratos.yml --dev --watch-courier volumes: - type: bind source: ./config/kratos target: /etc/config/kratos networks: - intranet hydra: image: oryd/hydra:v2.2.0 ports: - "4444:4444" - "4445:4445" - "5555:5555" command: serve -c /etc/config/hydra/hydra.yml all --dev volumes: - type: bind source: ./config/hydra target: /etc/config/hydra environment: - LOG_LEVEL=debug - OAUTH2_EXPOSE_INTERNAL_ERRORS=1 - SERVE_PUBLIC_CORS_ENABLED=true - SERVE_PUBLIC_CORS_ALLOWED_METHODS=POST,GET,PUT,DELETE - SERVE_ADMIN_CORS_ENABLED=true - SERVE_ADMIN_CORS_ALLOWED_METHODS=POST,GET,PUT,DELETE - DSN=postgres://hydra:ChangeMe!@postgres:5432/hydra?sslmode=prefer&max_conns=20&max_idle_conns=4 restart: unless-stopped depends_on: - hydra-migrate networks: - intranet hydra-migrate: image: oryd/hydra:v2.2.0 environment: - DSN=postgres://hydra:ChangeMe!@postgres:5432/hydra?sslmode=prefer&max_conns=20&max_idle_conns=4 command: migrate -c /etc/config/hydra/hydra.yml sql -e --yes volumes: - type: bind source: ./config/hydra target: /etc/config/hydra networks: - intranet depends_on: postgres: condition: service_healthy networks: intranet: driver: bridge volumes: nats_data: postgres_data: config: driver: local driver_opts: type: none o: bind device: ./config csvs: driver: local driver_opts: type: none o: bind device: ./csvs logs: driver: local driver_opts: type: none o: bind device: ./logs node_modules: