mirror of
https://github.com/getlago/lago.git
synced 2024-12-22 21:13:24 +07:00
c8f41339a5
* misc(docker): Add a dedicated Sidekiq Events Worker * fix api env vars
216 lines
8.2 KiB
YAML
216 lines
8.2 KiB
YAML
version: "3.8"
|
|
|
|
volumes:
|
|
front_node_modules:
|
|
front_dist:
|
|
postgres_data:
|
|
redis_data:
|
|
redpanda_data:
|
|
|
|
services:
|
|
traefik:
|
|
image: "traefik:v2.5.4"
|
|
container_name: lago_traefik
|
|
ports:
|
|
- 80:80
|
|
- 443:443
|
|
volumes:
|
|
- ./traefik/traefik.yml:/etc/traefik/traefik.yml
|
|
- ./traefik/dynamic.yml:/etc/traefik/dynamic.yml
|
|
- ./traefik/certs:/etc/certs
|
|
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.traefik.rule=Host(`traefik.lago.dev`)"
|
|
- "traefik.http.routers.traefik.entrypoints=web,websecure"
|
|
- "traefik.http.routers.traefik.tls=true"
|
|
- "traefik.http.services.traefik.loadbalancer.server.port=8080"
|
|
|
|
db:
|
|
image: postgres:14.0-alpine
|
|
container_name: lago_db
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-lago}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
|
|
PGDATA: /data/postgres
|
|
POSTGRES_MULTIPLE_DATABASES: lago,lago_test
|
|
volumes:
|
|
- ./pg-init-scripts:/docker-entrypoint-initdb.d
|
|
- postgres_data:/data/postgres
|
|
ports:
|
|
- 5432:5432
|
|
|
|
redis:
|
|
image: redis:6.2-alpine
|
|
container_name: lago_redis
|
|
restart: unless-stopped
|
|
volumes:
|
|
- redis_data:/data
|
|
ports:
|
|
- 6379:6379
|
|
|
|
front:
|
|
image: front
|
|
container_name: lago_front
|
|
stdin_open: true
|
|
restart: unless-stopped
|
|
build:
|
|
context: ./front
|
|
dockerfile: $LAGO_PATH/front/Dockerfile.dev
|
|
volumes:
|
|
- $LAGO_PATH/front:/app:delegated
|
|
- front_node_modules:/app/node_modules:delegated
|
|
- front_dist:/app/dist:delegated
|
|
environment:
|
|
- NODE_ENV=development
|
|
- API_URL=https://api.lago.dev
|
|
- APP_DOMAIN=https://app.lago.dev
|
|
- CODEGEN_API=https://api.lago.dev:3000
|
|
- LAGO_DISABLE_SIGNUP=${LAGO_DISABLE_SIGNUP:-}
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.app.rule=Host(`app.lago.dev`)"
|
|
- "traefik.http.routers.app.entrypoints=web,ws,websecure"
|
|
- "traefik.http.routers.app.tls=true"
|
|
- "traefik.http.services.app.loadbalancer.server.port=8080"
|
|
|
|
api:
|
|
image: api
|
|
container_name: lago_api
|
|
restart: unless-stopped
|
|
command: ["./scripts/start.dev.sh"]
|
|
build:
|
|
context: ./api
|
|
dockerfile: $LAGO_PATH/api/Dockerfile.dev
|
|
volumes:
|
|
- $LAGO_PATH/api:/app:delegated
|
|
environment:
|
|
- LAGO_API_URL=https://api.lago.dev
|
|
- DATABASE_URL=postgresql://${POSTGRES_USER:-lago}:${POSTGRES_PASSWORD:-changeme}@db:5432/${POSTGRES_DB:-lago}
|
|
- DATABASE_TEST_URL=postgresql://${POSTGRES_USER:-lago}:${POSTGRES_PASSWORD:-changeme}@db:5432/${POSTGRES_DB:-lago_test}
|
|
- REDIS_URL=redis://redis:6379
|
|
- SECRET_KEY_BASE=${SECRET_KEY_BASE:-your-secret-key-base-hex-64}
|
|
- LAGO_FRONT_URL=${FRONT_URL:-https://app.lago.dev}
|
|
- ENCRYPTION_PRIMARY_KEY=${ENCRYPTION_PRIMARY_KEY:-your-encrpytion-primary-key}
|
|
- ENCRYPTION_DETERMINISTIC_KEY=${ENCRYPTION_DETERMINISTIC_KEY:-your-encrpytion-deterministic-key}
|
|
- ENCRYPTION_KEY_DERIVATION_SALT=${ENCRYPTION_KEY_DERIVATION_SALT:-your-encrpytion-derivation-salt}
|
|
- LAGO_USE_AWS_S3=${LAGO_USE_AWS_S3:-false}
|
|
- LAGO_PDF_URL=${LAGO_PDF_URL:-http://pdf:3000}
|
|
- LAGO_REDIS_CACHE_URL=redis://redis:6379
|
|
- SEGMENT_WRITE_KEY=${SEGMENT_WRITE_KEY:-}
|
|
- LAGO_DISABLE_SEGMENT=${LAGO_DISABLE_SEGMENT:-}
|
|
- LAGO_LICENSE=${LAGO_LICENSE:-}
|
|
- LAGO_FROM_EMAIL=${LAGO_FROM_EMAIL:-noreply@getlago.com}
|
|
- LAGO_SIDEKIQ_WEB=true
|
|
- SIDEKIQ_EVENTS=true
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.api_http.rule=Host(`api.lago.dev`)"
|
|
- "traefik.http.routers.api_http.entrypoints=web"
|
|
- "traefik.http.routers.api_http.service=api_http"
|
|
- "traefik.http.services.api_http.loadbalancer.server.port=3000"
|
|
- "traefik.http.routers.api.rule=Host(`api.lago.dev`)"
|
|
- "traefik.http.routers.api.entrypoints=websecure"
|
|
- "traefik.http.routers.api.service=api"
|
|
- "traefik.http.routers.api.tls=true"
|
|
- "traefik.http.services.api.loadbalancer.server.port=3000"
|
|
|
|
api-worker:
|
|
image: api
|
|
container_name: lago_api_worker
|
|
restart: unless-stopped
|
|
command: ["./scripts/start.worker.dev.sh"]
|
|
build:
|
|
context: ./api
|
|
dockerfile: $LAGO_PATH/api/Dockerfile.dev
|
|
volumes:
|
|
- $LAGO_PATH/api:/app:delegated
|
|
environment:
|
|
- LAGO_API_URL=https://api.lago.dev
|
|
- DATABASE_URL=postgresql://${POSTGRES_USER:-lago}:${POSTGRES_PASSWORD:-changeme}@db:5432/${POSTGRES_DB:-lago}
|
|
- REDIS_URL=redis://redis:6379
|
|
- SECRET_KEY_BASE=${SECRET_KEY_BASE:-your-secret-key-base-hex-64}
|
|
- ENCRYPTION_PRIMARY_KEY=${ENCRYPTION_PRIMARY_KEY:-your-encrpytion-primary-key}
|
|
- ENCRYPTION_DETERMINISTIC_KEY=${ENCRYPTION_DETERMINISTIC_KEY:-your-encrpytion-deterministic-key}
|
|
- ENCRYPTION_KEY_DERIVATION_SALT=${ENCRYPTION_KEY_DERIVATION_SALT:-your-encrpytion-derivation-salt}
|
|
- LAGO_USE_AWS_S3=${LAGO_USE_AWS_S3:-false}
|
|
- LAGO_FRONT_URL=${FRONT_URL:-https://app.lago.dev}
|
|
- LAGO_PDF_URL=${LAGO_PDF_URL:-http://pdf:3000}
|
|
- LAGO_REDIS_CACHE_URL=redis://redis:6379
|
|
- SEGMENT_WRITE_KEY=${SEGMENT_WRITE_KEY:-}
|
|
- LAGO_DISABLE_SEGMENT=${LAGO_DISABLE_SEGMENT:-}
|
|
- LAGO_FROM_EMAIL=${LAGO_FROM_EMAIL:-noreply@getlago.com}
|
|
- SIDEKIQ_EVENTS=true
|
|
|
|
api-events-worker:
|
|
image: api
|
|
container_name: lago_api_events_worker
|
|
restart: unless-stopped
|
|
command: ["./scripts/start.events.worker.dev.sh"]
|
|
build:
|
|
context: ./api
|
|
dockerfile: $LAGO_PATH/api/Dockerfile.dev
|
|
volumes:
|
|
- $LAGO_PATH/api:/app:delegated
|
|
environment:
|
|
- LAGO_API_URL=https://api.lago.dev
|
|
- DATABASE_URL=postgresql://${POSTGRES_USER:-lago}:${POSTGRES_PASSWORD:-changeme}@db:5432/${POSTGRES_DB:-lago}
|
|
- REDIS_URL=redis://redis:6379
|
|
- SECRET_KEY_BASE=${SECRET_KEY_BASE:-your-secret-key-base-hex-64}
|
|
- ENCRYPTION_PRIMARY_KEY=${ENCRYPTION_PRIMARY_KEY:-your-encrpytion-primary-key}
|
|
- ENCRYPTION_DETERMINISTIC_KEY=${ENCRYPTION_DETERMINISTIC_KEY:-your-encrpytion-deterministic-key}
|
|
- ENCRYPTION_KEY_DERIVATION_SALT=${ENCRYPTION_KEY_DERIVATION_SALT:-your-encrpytion-derivation-salt}
|
|
- LAGO_USE_AWS_S3=${LAGO_USE_AWS_S3:-false}
|
|
- LAGO_FRONT_URL=${FRONT_URL:-https://app.lago.dev}
|
|
- LAGO_PDF_URL=${LAGO_PDF_URL:-http://pdf:3000}
|
|
- LAGO_REDIS_CACHE_URL=redis://redis:6379
|
|
- SEGMENT_WRITE_KEY=${SEGMENT_WRITE_KEY:-}
|
|
- LAGO_DISABLE_SEGMENT=${LAGO_DISABLE_SEGMENT:-}
|
|
- LAGO_FROM_EMAIL=${LAGO_FROM_EMAIL:-noreply@getlago.com}
|
|
- SIDEKIQ_EVENTS=true
|
|
|
|
api-clock:
|
|
image: api
|
|
container_name: lago_api_clock
|
|
restart: unless-stopped
|
|
command: ["./scripts/start.clock.dev.sh"]
|
|
build:
|
|
context: ./api
|
|
dockerfile: $LAGO_PATH/api/Dockerfile.dev
|
|
volumes:
|
|
- $LAGO_PATH/api:/app:delegated
|
|
environment:
|
|
- LAGO_API_URL=https://api.lago.dev
|
|
- DATABASE_URL=postgresql://${POSTGRES_USER:-lago}:${POSTGRES_PASSWORD:-changeme}@db:5432/${POSTGRES_DB:-lago}
|
|
- REDIS_URL=redis://redis:6379
|
|
- SECRET_KEY_BASE=${SECRET_KEY_BASE:-your-secret-key-base-hex-64}
|
|
- ENCRYPTION_PRIMARY_KEY=${ENCRYPTION_PRIMARY_KEY:-your-encrpytion-primary-key}
|
|
- ENCRYPTION_DETERMINISTIC_KEY=${ENCRYPTION_DETERMINISTIC_KEY:-your-encrpytion-deterministic-key}
|
|
- ENCRYPTION_KEY_DERIVATION_SALT={ENCRYPTION_KEY_DERIVATION_SALT:-your-encrpytion-derivation-salt}
|
|
- SEGMENT_WRITE_KEY=${SEGMENT_WRITE_KEY:-}
|
|
- LAGO_DISABLE_SEGMENT=${LAGO_DISABLE_SEGMENT:-}
|
|
|
|
pdf:
|
|
image: getlago/lago-gotenberg:7
|
|
command:
|
|
- "gotenberg"
|
|
- "--log-level=debug"
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.pdf.rule=Host(`pdf.lago.dev`)"
|
|
- "traefik.http.routers.pdf.entrypoints=web,websecure"
|
|
- "traefik.http.routers.pdf.tls=true"
|
|
- "traefik.http.services.pdf.loadbalancer.server.port=3000"
|
|
|
|
mailhog:
|
|
image: mailhog/mailhog
|
|
container_name: lago_mailhog
|
|
restart: unless-stopped
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.mail.rule=Host(`mail.lago.dev`)"
|
|
- "traefik.http.routers.mail.entrypoints=websecure"
|
|
- "traefik.http.routers.mail.tls=true"
|
|
- "traefik.http.services.mail.loadbalancer.server.port=8025"
|