chore(docker): Add Billing Worker configuration (#433)

This commit is contained in:
Jérémy Denquin 2024-12-05 16:55:24 +01:00 committed by GitHub
parent 853b399173
commit 12857add27
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 94 additions and 6 deletions

2
api

@ -1 +1 @@
Subproject commit 8141920c8791989365caba2d180c643b52e1d5ff Subproject commit a62be9c5c5aca88076fb5285b291d23589e00e1e

View File

@ -112,6 +112,7 @@ services:
- LAGO_SIDEKIQ_WEB=true - LAGO_SIDEKIQ_WEB=true
- SIDEKIQ_EVENTS=true - SIDEKIQ_EVENTS=true
- SIDEKIQ_PDFS=true - SIDEKIQ_PDFS=true
- SIDEKIQ_BILLING=true
- LAGO_CLICKHOUSE_ENABLED=true - LAGO_CLICKHOUSE_ENABLED=true
- LAGO_CLICKHOUSE_MIGRATIONS_ENABLED=true - LAGO_CLICKHOUSE_MIGRATIONS_ENABLED=true
- LAGO_KAFKA_BOOTSTRAP_SERVERS=redpanda:9092 - LAGO_KAFKA_BOOTSTRAP_SERVERS=redpanda:9092
@ -137,7 +138,7 @@ services:
image: api_dev image: api_dev
container_name: lago_api_worker container_name: lago_api_worker
restart: unless-stopped restart: unless-stopped
command: ["./scripts/start.worker.dev.sh"] command: bash -c "bundle install && ./scripts/start.worker.sh"
depends_on: depends_on:
- api - api
build: build:
@ -164,6 +165,7 @@ services:
- LAGO_FROM_EMAIL=${LAGO_FROM_EMAIL:-noreply@getlago.com} - LAGO_FROM_EMAIL=${LAGO_FROM_EMAIL:-noreply@getlago.com}
- SIDEKIQ_EVENTS=true - SIDEKIQ_EVENTS=true
- SIDEKIQ_PDFS=true - SIDEKIQ_PDFS=true
- SIDEKIQ_BILLING=true
- LAGO_CLICKHOUSE_ENABLED=true - LAGO_CLICKHOUSE_ENABLED=true
- LAGO_CLICKHOUSE_MIGRATIONS_ENABLED=true - LAGO_CLICKHOUSE_MIGRATIONS_ENABLED=true
- LAGO_KAFKA_BOOTSTRAP_SERVERS=redpanda:9092 - LAGO_KAFKA_BOOTSTRAP_SERVERS=redpanda:9092
@ -179,7 +181,7 @@ services:
depends_on: depends_on:
- api - api
restart: unless-stopped restart: unless-stopped
command: ["./scripts/start.events.worker.dev.sh"] command: bash -c "bundle install && ./scripts/start.events.worker.sh"
build: build:
context: ./api context: ./api
dockerfile: $LAGO_PATH/api/Dockerfile.dev dockerfile: $LAGO_PATH/api/Dockerfile.dev
@ -203,6 +205,7 @@ services:
- LAGO_DISABLE_WALLET_REFRESH=${LAGO_DISABLE_WALLET_REFRESH:-} - LAGO_DISABLE_WALLET_REFRESH=${LAGO_DISABLE_WALLET_REFRESH:-}
- LAGO_FROM_EMAIL=${LAGO_FROM_EMAIL:-noreply@getlago.com} - LAGO_FROM_EMAIL=${LAGO_FROM_EMAIL:-noreply@getlago.com}
- SIDEKIQ_EVENTS=true - SIDEKIQ_EVENTS=true
- SIDEKIQ_BILLING=true
- LAGO_CLICKHOUSE_ENABLED=true - LAGO_CLICKHOUSE_ENABLED=true
- LAGO_CLICKHOUSE_MIGRATIONS_ENABLED=true - LAGO_CLICKHOUSE_MIGRATIONS_ENABLED=true
- LAGO_KAFKA_BOOTSTRAP_SERVERS=redpanda:9092 - LAGO_KAFKA_BOOTSTRAP_SERVERS=redpanda:9092
@ -218,7 +221,7 @@ services:
depends_on: depends_on:
- api - api
restart: unless-stopped restart: unless-stopped
command: ["./scripts/start.pdfs.worker.dev.sh"] command: bash -c "bundle install && ./scripts/start.pdfs.worker.sh"
build: build:
context: ./api context: ./api
dockerfile: $LAGO_PATH/api/Dockerfile.dev dockerfile: $LAGO_PATH/api/Dockerfile.dev
@ -251,11 +254,51 @@ services:
- NANGO_SECRET_KEY=${NANGO_SECRET_KEY:-} - NANGO_SECRET_KEY=${NANGO_SECRET_KEY:-}
- LAGO_LICENSE=${LAGO_LICENSE:-} - LAGO_LICENSE=${LAGO_LICENSE:-}
api-billing-worker:
image: api_dev
container_name: lago_api_billing_worker_dev
depends_on:
- api
restart: unless-stopped
command: bash -c "bundle install && ./scripts/start.billing.worker.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}
- LAGO_ENCRYPTION_PRIMARY_KEY=${ENCRYPTION_PRIMARY_KEY:-your-encrpytion-primary-key}
- LAGO_ENCRYPTION_DETERMINISTIC_KEY=${ENCRYPTION_DETERMINISTIC_KEY:-your-encrpytion-deterministic-key}
- LAGO_ENCRYPTION_KEY_DERIVATION_SALT=${ENCRYPTION_KEY_DERIVATION_SALT:-your-encrpytion-derivation-salt}
- LAGO_USE_AWS_S3=${LAGO_USE_AWS_S3:-false}
- LAGO_FRONT_URL=${LAGO_FRONT_URL:-https://app.lago.dev}
- LAGO_PARALLEL_THREADS_COUNT=${LAGO_PARALLEL_THREADS_COUNT:-4}
- 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_DISABLE_WALLET_REFRESH=${LAGO_DISABLE_WALLET_REFRESH:-}
- LAGO_FROM_EMAIL=${LAGO_FROM_EMAIL:-noreply@getlago.com}
- SIDEKIQ_PDFS=true
- SIDEKIQ_BILLING=true
- LAGO_CLICKHOUSE_ENABLED=true
- LAGO_CLICKHOUSE_MIGRATIONS_ENABLED=true
- LAGO_KAFKA_BOOTSTRAP_SERVERS=redpanda:9092
- LAGO_KAFKA_RAW_EVENTS_TOPIC=events-raw
- LAGO_KAFKA_ENRICHED_EVENTS_TOPIC=events_enriched
- LAGO_KAFKA_CLICKHOUSE_CONSUMER_GROUP=clickhouse
- NANGO_SECRET_KEY=${NANGO_SECRET_KEY:-}
- LAGO_LICENSE=${LAGO_LICENSE:-}
api-clock: api-clock:
image: api_dev image: api_dev
container_name: lago_api_clock_dev container_name: lago_api_clock_dev
restart: unless-stopped restart: unless-stopped
command: ["./scripts/start.clock.dev.sh"] command: bash -c "bundle install && ./scripts/start.clock.sh"
depends_on: depends_on:
- api - api
build: build:

View File

@ -82,6 +82,7 @@ services:
- NANGO_SECRET_KEY=${NANGO_SECRET_KEY:-} - NANGO_SECRET_KEY=${NANGO_SECRET_KEY:-}
# - SIDEKIQ_EVENTS=true # - SIDEKIQ_EVENTS=true
# - SIDEKIQ_PDFS=true # - SIDEKIQ_PDFS=true
# - SIDEKIQ_BILLING=true
volumes: volumes:
- lago_storage_data:/app/storage - lago_storage_data:/app/storage
# If using GCS, you need to put the credentials keyfile here # If using GCS, you need to put the credentials keyfile here
@ -260,6 +261,50 @@ services:
# - SIDEKIQ_PDFS=true # - SIDEKIQ_PDFS=true
# - LAGO_LICENSE=${LAGO_LICENSE:-} # - LAGO_LICENSE=${LAGO_LICENSE:-}
# You can uncomment this if you want to use a dedicated Sidekiq worker for the invoices creation.
# It is recommended if you have a high usage of invoices being created to not impact the other Sidekiq Jobs.
#api-billing-worker:
# container_name: lago-billing-worker
# image: getlago/api:v1.17.0
# restart: unless-stopped
# depends_on:
# api:
# condition: service_healthy
# command: ["./scripts/start.billing.worker.sh"]
# environment:
# - LAGO_API_URL=${LAGO_API_URL:-http://localhost:3000}
# - DATABASE_URL=postgresql://${POSTGRES_USER:-lago}:${POSTGRES_PASSWORD:-changeme}@${POSTGRES_HOST:-db}:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-lago}?search_path=${POSTGRES_SCHEMA:-public}
# - REDIS_URL=redis://${REDIS_HOST:-redis}:${REDIS_PORT:-6379}
# - REDIS_PASSWORD=${REDIS_PASSWORD}
# - SECRET_KEY_BASE=${SECRET_KEY_BASE:-your-secret-key-base-hex-64}
# - RAILS_ENV=production
# - RAILS_LOG_TO_STDOUT=${LAGO_RAILS_STDOUT:-true}
# - SENTRY_DSN=${SENTRY_DSN}
# - LAGO_RSA_PRIVATE_KEY=${LAGO_RSA_PRIVATE_KEY} # Should be base64 encoded
# - RSA_PRIVATE_KEY=${LAGO_RSA_PRIVATE_KEY} # Should be base64 encoded
# - LAGO_ENCRYPTION_PRIMARY_KEY=${LAGO_ENCRYPTION_PRIMARY_KEY:-your-encryption-primary-key}
# - LAGO_ENCRYPTION_DETERMINISTIC_KEY=${LAGO_ENCRYPTION_DETERMINISTIC_KEY:-your-encryption-deterministic-key}
# - LAGO_ENCRYPTION_KEY_DERIVATION_SALT=${LAGO_ENCRYPTION_KEY_DERIVATION_SALT:-your-encryption-derivation-salt}
# - LAGO_FRONT_URL=${LAGO_FRONT_URL:-http://localhost}
# - LAGO_USE_AWS_S3=${LAGO_USE_AWS_S3:-false}
# - LAGO_AWS_S3_ACCESS_KEY_ID=${LAGO_AWS_S3_ACCESS_KEY_ID:-azerty123456}
# - LAGO_AWS_S3_SECRET_ACCESS_KEY=${LAGO_AWS_S3_SECRET_ACCESS_KEY:-azerty123456}
# - LAGO_AWS_S3_REGION=${LAGO_AWS_S3_REGION:-us-east-1}
# - LAGO_AWS_S3_BUCKET=${LAGO_AWS_S3_BUCKET:-bucket}
# - LAGO_AWS_S3_ENDPOINT=${LAGO_AWS_S3_ENDPOINT}
# - LAGO_USE_GCS=${LAGO_USE_GCS:-false}
# - LAGO_GCS_PROJECT=${LAGO_GCS_PROJECT:-}
# - LAGO_GCS_BUCKET=${LAGO_GCS_BUCKET:-}
# - LAGO_PDF_URL=${LAGO_PDF_URL:-http://pdf:3000}
# - LAGO_REDIS_CACHE_URL=redis://${LAGO_REDIS_CACHE_HOST:-redis}:${LAGO_REDIS_CACHE_PORT:-6379}
# - LAGO_REDIS_CACHE_PASSWORD=${LAGO_REDIS_CACHE_PASSWORD}
# - LAGO_DISABLE_SEGMENT=${LAGO_DISABLE_SEGMENT}
# - LAGO_DISABLE_WALLET_REFRESH=${LAGO_DISABLE_WALLET_REFRESH}
# - NANGO_SECRET_KEY=${NANGO_SECRET_KEY:-}
# - SIDEKIQ_PDFS=true
# - SIDEKIQ_BILLING=true
# - LAGO_LICENSE=${LAGO_LICENSE:-}
api-clock: api-clock:
container_name: lago-clock container_name: lago-clock
image: getlago/api:v1.17.0 image: getlago/api:v1.17.0

2
front

@ -1 +1 @@
Subproject commit 9e850acfddc9545a3b3ff6c492fa4834e31c1202 Subproject commit 86a699c0e82aa666946df83827729c28b0692414