feat(15-01): add Logto service to Docker Compose and create init script
- Add Logto OIDC provider to docker-compose.yml and docker-compose.dev.yml - Create docker/init-logto-db.sql to initialize separate Logto database on Postgres - Add OIDC env vars (issuer, client ID/secret, auth secret) to app service - Document all required env vars in .env.example
This commit is contained in:
35
docker-compose.dev.yml
Normal file
35
docker-compose.dev.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
environment:
|
||||
POSTGRES_USER: gearbox
|
||||
POSTGRES_PASSWORD: gearbox
|
||||
POSTGRES_DB: gearbox
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- pgdata-dev:/var/lib/postgresql/data
|
||||
- ./docker/init-logto-db.sql:/docker-entrypoint-initdb.d/init-logto-db.sql
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U gearbox"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 5
|
||||
|
||||
logto:
|
||||
image: svhd/logto:latest
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
entrypoint: ["sh", "-c", "npm run cli db seed -- --swe && npm start"]
|
||||
ports:
|
||||
- "3001:3001"
|
||||
- "3002:3002"
|
||||
environment:
|
||||
TRUST_PROXY_HEADER: "1"
|
||||
DB_URL: postgres://gearbox:gearbox@postgres:5432/logto
|
||||
ENDPOINT: ${LOGTO_ENDPOINT:-http://localhost:3001}
|
||||
ADMIN_ENDPOINT: ${LOGTO_ADMIN_ENDPOINT:-http://localhost:3002}
|
||||
|
||||
volumes:
|
||||
pgdata-dev:
|
||||
Reference in New Issue
Block a user