2022-04-11 22:57:34 +07:00
|
|
|
volumes:
|
|
|
|
lago_postgres_data:
|
|
|
|
lago_redis_data:
|
2022-09-28 20:07:31 +07:00
|
|
|
lago_storage_data:
|
2022-04-11 22:57:34 +07:00
|
|
|
|
2025-01-30 18:22:19 +07:00
|
|
|
x-postgres-image: &postgres-image
|
|
|
|
image: postgres:14-alpine
|
|
|
|
x-redis-image: &redis-image
|
|
|
|
image: redis:6-alpine
|
|
|
|
x-backend-image: &backend-image
|
2025-02-12 19:56:09 +07:00
|
|
|
image: getlago/api:v1.21.0
|
2025-01-30 18:22:19 +07:00
|
|
|
x-frontend-image: &frontend-image
|
2025-02-12 19:56:09 +07:00
|
|
|
image: getlago/front:v1.21.0
|
2025-01-30 18:22:19 +07:00
|
|
|
|
|
|
|
x-lago-api-url: &lago-api-url
|
|
|
|
"LAGO_API_URL": ${LAGO_API_URL:-http://localhost:3000}
|
|
|
|
x-lago-front-url: &lago-front-url
|
|
|
|
"LAGO_FRONT_URL": ${LAGO_FRONT_URL:-http://localhost}
|
|
|
|
|
|
|
|
x-backend-environment: &backend-env
|
|
|
|
"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}
|
|
|
|
"LAGO_RSA_PRIVATE_KEY": ${LAGO_RSA_PRIVATE_KEY}
|
|
|
|
"LAGO_SIDEKIQ_WEB": ${LAGO_SIDEKIQ_WEB:-true}
|
|
|
|
"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_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_FROM_EMAIL": ${LAGO_FROM_EMAIL:-}
|
|
|
|
"LAGO_SMTP_ADDRESS": ${LAGO_SMTP_ADDRESS:-}
|
|
|
|
"LAGO_SMTP_PORT": ${LAGO_SMTP_PORT:-587}
|
|
|
|
"LAGO_SMTP_USERNAME": ${LAGO_SMTP_USERNAME:-}
|
|
|
|
"LAGO_SMTP_PASSWORD": ${LAGO_SMTP_PASSWORD:-}
|
|
|
|
"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}
|
|
|
|
"LAGO_DISABLE_SIGNUP": ${LAGO_DISABLE_SIGNUP:-false}
|
|
|
|
"LAGO_OAUTH_PROXY_URL": https://proxy.getlago.com
|
|
|
|
"LAGO_LICENSE": ${LAGO_LICENSE:-}
|
|
|
|
"LAGO_CREATE_ORG": ${LAGO_CREATE_ORG:-false}
|
|
|
|
"LAGO_ORG_USER_PASSWORD": ${LAGO_ORG_USER_PASSWORD:-}
|
|
|
|
"LAGO_ORG_USER_EMAIL": ${LAGO_ORG_USER_EMAIL:-}
|
|
|
|
"LAGO_ORG_NAME": ${LAGO_ORG_NAME:-}
|
|
|
|
"LAGO_ORG_API_KEY": ${LAGO_ORG_API_KEY:-}
|
|
|
|
"GOOGLE_AUTH_CLIENT_ID": ${GOOGLE_AUTH_CLIENT_ID:-}
|
|
|
|
"GOOGLE_AUTH_CLIENT_SECRET": ${GOOGLE_AUTH_CLIENT_SECRET:-}
|
|
|
|
# - SIDEKIQ_EVENTS=true
|
|
|
|
# - SIDEKIQ_PDFS=true
|
|
|
|
# - SIDEKIQ_BILLING=true
|
|
|
|
# - SIDEKIQ_CLOCK=true
|
|
|
|
# - SIDEKIQ_WEBHOOK=true
|
|
|
|
x-frontend-environment: &frontend-env
|
|
|
|
"API_URL": ${LAGO_API_URL:-http://localhost:3000}
|
|
|
|
"APP_ENV": production
|
|
|
|
"LAGO_OAUTH_PROXY_URL": https://proxy.getlago.com
|
|
|
|
|
2022-04-11 22:57:34 +07:00
|
|
|
services:
|
|
|
|
db:
|
2025-01-30 18:22:19 +07:00
|
|
|
<<: *postgres-image
|
2022-04-11 22:57:34 +07:00
|
|
|
container_name: lago-db
|
|
|
|
restart: unless-stopped
|
2025-01-21 23:36:24 +07:00
|
|
|
healthcheck:
|
|
|
|
test:
|
|
|
|
[
|
|
|
|
"CMD-SHELL",
|
|
|
|
"pg_isready -U ${POSTGRES_USER:-lago} -d ${POSTGRES_DB:-lago} -h localhost -p ${POSTGRES_PORT:-5432}",
|
|
|
|
]
|
|
|
|
interval: 10s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 5
|
2022-04-11 22:57:34 +07:00
|
|
|
environment:
|
|
|
|
POSTGRES_DB: ${POSTGRES_DB:-lago}
|
|
|
|
POSTGRES_USER: ${POSTGRES_USER:-lago}
|
|
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
|
|
|
|
PGDATA: /data/postgres
|
2023-07-07 16:43:27 +07:00
|
|
|
PGPORT: ${POSTGRES_PORT:-5432}
|
2024-06-06 14:24:27 +07:00
|
|
|
POSTGRES_SCHEMA: public
|
2022-04-11 22:57:34 +07:00
|
|
|
volumes:
|
|
|
|
- lago_postgres_data:/data/postgres
|
|
|
|
ports:
|
2023-07-07 16:43:27 +07:00
|
|
|
- ${POSTGRES_PORT:-5432}:${POSTGRES_PORT:-5432}
|
2022-04-11 22:57:34 +07:00
|
|
|
|
|
|
|
redis:
|
2025-01-30 18:22:19 +07:00
|
|
|
<<: *redis-image
|
2022-04-11 22:57:34 +07:00
|
|
|
container_name: lago-redis
|
|
|
|
restart: unless-stopped
|
2025-01-21 23:36:24 +07:00
|
|
|
healthcheck:
|
|
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
|
|
interval: 10s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 5
|
2025-01-30 18:22:19 +07:00
|
|
|
command: --port ${REDIS_PORT:-6379}
|
2022-04-11 22:57:34 +07:00
|
|
|
volumes:
|
|
|
|
- lago_redis_data:/data
|
|
|
|
ports:
|
2023-02-24 21:42:57 +07:00
|
|
|
- ${REDIS_PORT:-6379}:${REDIS_PORT:-6379}
|
2022-04-11 22:57:34 +07:00
|
|
|
|
2025-01-21 23:36:24 +07:00
|
|
|
migrate:
|
2025-01-30 18:22:19 +07:00
|
|
|
<<: *backend-image
|
2025-01-21 23:36:24 +07:00
|
|
|
container_name: lago-migrate
|
|
|
|
depends_on:
|
|
|
|
db:
|
|
|
|
condition: service_healthy
|
|
|
|
restart: true
|
|
|
|
command: ["./scripts/migrate.sh"]
|
|
|
|
environment:
|
2025-01-30 18:22:19 +07:00
|
|
|
<<: *backend-env
|
2025-01-21 23:36:24 +07:00
|
|
|
|
2022-04-11 22:57:34 +07:00
|
|
|
api:
|
2025-01-30 18:22:19 +07:00
|
|
|
<<: *backend-image
|
2022-04-11 22:57:34 +07:00
|
|
|
container_name: lago-api
|
|
|
|
restart: unless-stopped
|
|
|
|
depends_on:
|
2025-01-21 23:36:24 +07:00
|
|
|
migrate:
|
|
|
|
condition: service_completed_successfully
|
|
|
|
db:
|
|
|
|
condition: service_healthy
|
|
|
|
restart: true
|
|
|
|
redis:
|
|
|
|
condition: service_healthy
|
|
|
|
restart: true
|
|
|
|
command: ["./scripts/start.api.sh"]
|
2023-10-15 19:53:59 +07:00
|
|
|
healthcheck:
|
2024-02-01 14:31:25 +07:00
|
|
|
test: curl -f http://localhost:3000/health || exit 1
|
|
|
|
interval: 10s
|
|
|
|
start_period: 30s
|
|
|
|
timeout: 60s
|
2025-01-30 18:22:19 +07:00
|
|
|
start_interval: 2s
|
2022-04-11 22:57:34 +07:00
|
|
|
environment:
|
2025-01-30 18:22:19 +07:00
|
|
|
<<: [*backend-env, *lago-api-url, *lago-front-url]
|
2022-09-28 20:07:31 +07:00
|
|
|
volumes:
|
|
|
|
- lago_storage_data:/app/storage
|
2022-04-11 22:57:34 +07:00
|
|
|
ports:
|
|
|
|
- ${API_PORT:-3000}:3000
|
|
|
|
|
|
|
|
front:
|
2025-01-30 18:22:19 +07:00
|
|
|
<<: *frontend-image
|
2022-04-11 22:57:34 +07:00
|
|
|
container_name: lago-front
|
|
|
|
restart: unless-stopped
|
2022-07-26 16:52:08 +07:00
|
|
|
# Use this command if you want to use SSL with Let's Encrypt
|
|
|
|
# command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
|
2022-04-11 22:57:34 +07:00
|
|
|
depends_on:
|
2024-02-01 14:31:25 +07:00
|
|
|
api:
|
|
|
|
condition: service_healthy
|
2025-01-21 23:36:24 +07:00
|
|
|
restart: true
|
2022-04-11 22:57:34 +07:00
|
|
|
environment:
|
2025-01-30 18:22:19 +07:00
|
|
|
<<: [*frontend-env, *lago-api-url, *lago-front-url]
|
2022-04-11 22:57:34 +07:00
|
|
|
ports:
|
|
|
|
- ${FRONT_PORT:-80}:80
|
2022-10-12 21:08:37 +07:00
|
|
|
# - 443:443
|
2022-07-26 16:52:08 +07:00
|
|
|
# Using SSL with Let's Encrypt
|
|
|
|
# volumes:
|
|
|
|
# - ./extra/nginx-letsencrypt.conf:/etc/nginx/conf.d/default.conf
|
|
|
|
# - ./extra/certbot/conf:/etc/letsencrypt
|
|
|
|
# - ./extra/certbot/www:/var/www/certbot
|
|
|
|
# Using SSL with self signed certificates
|
|
|
|
# volumes:
|
|
|
|
# - ./extra/nginx-selfsigned.conf:/etc/nginx/conf.d/default.conf
|
|
|
|
# - ./extra/ssl/nginx-selfsigned.crt:/etc/ssl/certs/nginx-selfsigned.crt
|
|
|
|
# - ./extra/ssl/nginx-selfsigned.key:/etc/ssl/private/nginx-selfsigned.key
|
|
|
|
# - ./extra/ssl/dhparam.pem:/etc/ssl/certs/dhparam.pem
|
|
|
|
|
|
|
|
# Only used for SSL support with Let's Encrypt
|
2022-10-12 21:08:37 +07:00
|
|
|
# certbot:
|
|
|
|
# image: certbot/certbot
|
|
|
|
# entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
|
|
|
|
# volumes:
|
|
|
|
# - ./extra/certbot/conf:/etc/letsencrypt
|
|
|
|
# - ./extra/certbot/www:/var/www/certbot
|
2022-04-11 22:57:34 +07:00
|
|
|
|
|
|
|
api-worker:
|
2025-01-30 18:22:19 +07:00
|
|
|
<<: *backend-image
|
2022-04-11 22:57:34 +07:00
|
|
|
container_name: lago-worker
|
|
|
|
restart: unless-stopped
|
|
|
|
depends_on:
|
2025-01-21 23:36:24 +07:00
|
|
|
migrate:
|
|
|
|
condition: service_completed_successfully
|
|
|
|
db:
|
|
|
|
condition: service_healthy
|
|
|
|
restart: true
|
|
|
|
redis:
|
2024-02-01 14:31:25 +07:00
|
|
|
condition: service_healthy
|
2025-01-21 23:36:24 +07:00
|
|
|
restart: true
|
2025-01-14 22:40:29 +07:00
|
|
|
command: ["./scripts/start.worker.sh"]
|
2023-10-15 19:53:59 +07:00
|
|
|
healthcheck:
|
2025-01-30 18:22:19 +07:00
|
|
|
test: curl -f http://localhost:8080 || exit 1
|
|
|
|
interval: 10s
|
|
|
|
start_period: 30s
|
|
|
|
timeout: 60s
|
|
|
|
start_interval: 2s
|
2022-04-11 22:57:34 +07:00
|
|
|
environment:
|
2025-01-30 18:22:19 +07:00
|
|
|
<<: [*backend-env, *lago-api-url]
|
2022-09-28 20:07:31 +07:00
|
|
|
volumes:
|
|
|
|
- lago_storage_data:/app/storage
|
2023-11-06 16:00:22 +07:00
|
|
|
|
2023-10-05 22:59:58 +07:00
|
|
|
# You can uncomment this if you want to use a dedicated Sidekiq worker for the event ingestion.
|
|
|
|
# It is recommendend if you have a high usage of events to not impact the other Sidekiq Jobs.
|
|
|
|
#api-events-worker:
|
2025-01-30 18:22:19 +07:00
|
|
|
# <<: *backend-image
|
2023-10-05 22:59:58 +07:00
|
|
|
# container_name: lago-events-worker
|
|
|
|
# restart: unless-stopped
|
|
|
|
# depends_on:
|
2024-02-01 14:31:25 +07:00
|
|
|
# api:
|
|
|
|
# condition: service_healthy
|
2023-10-05 22:59:58 +07:00
|
|
|
# command: ["./scripts/start.events.worker.sh"]
|
|
|
|
# environment:
|
2025-01-30 18:22:19 +07:00
|
|
|
# <<: [*backend-env, *lago-api-url]
|
2022-04-11 22:57:34 +07:00
|
|
|
|
2024-06-13 22:22:59 +07:00
|
|
|
# You can uncomment this if you want to use a dedicated Sidekiq worker for the invoices pdf creation.
|
|
|
|
# It is recommended if you have a high usage of invoices being created to not impact the other Sidekiq Jobs.
|
|
|
|
#api-pdfs-worker:
|
2025-01-30 18:22:19 +07:00
|
|
|
# <<: *backend-image
|
2024-06-13 22:22:59 +07:00
|
|
|
# container_name: lago-pdfs-worker
|
|
|
|
# restart: unless-stopped
|
|
|
|
# depends_on:
|
|
|
|
# api:
|
|
|
|
# condition: service_healthy
|
|
|
|
# command: ["./scripts/start.pdfs.worker.sh"]
|
|
|
|
# environment:
|
2025-01-30 18:22:19 +07:00
|
|
|
# <<: [*backend-env, *lago-api-url]
|
2024-06-13 22:22:59 +07:00
|
|
|
|
2024-12-05 22:55:24 +07:00
|
|
|
# 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:
|
2025-01-30 18:22:19 +07:00
|
|
|
# <<: *backend-image
|
2024-12-05 22:55:24 +07:00
|
|
|
# container_name: lago-billing-worker
|
|
|
|
# restart: unless-stopped
|
|
|
|
# depends_on:
|
|
|
|
# api:
|
|
|
|
# condition: service_healthy
|
|
|
|
# command: ["./scripts/start.billing.worker.sh"]
|
|
|
|
# environment:
|
2025-01-30 18:22:19 +07:00
|
|
|
# <<: [*backend-env, *lago-api-url]
|
2024-12-18 23:14:23 +07:00
|
|
|
|
2024-12-19 17:45:13 +07:00
|
|
|
# You can uncomment this if you want to use a dedicated Sidekiq worker for the clock jobs.
|
2024-12-18 23:14:23 +07:00
|
|
|
#api-clock-worker:
|
2025-01-30 18:22:19 +07:00
|
|
|
# <<: *backend-image
|
2024-12-18 23:14:23 +07:00
|
|
|
# container_name: lago-clock-worker
|
|
|
|
# restart: unless-stopped
|
|
|
|
# depends_on:
|
|
|
|
# api:
|
|
|
|
# condition: service_healthy
|
|
|
|
# command: ["./scripts/start.clock.worker.sh"]
|
|
|
|
# environment:
|
2025-01-30 18:22:19 +07:00
|
|
|
# <<: [*backend-env, *lago-api-url]
|
2024-12-19 17:45:13 +07:00
|
|
|
|
|
|
|
# You can uncomment this if you want to use a dedicated Sidekiq worker for the webhook jobs.
|
|
|
|
#api-webhook-worker:
|
2025-01-30 18:22:19 +07:00
|
|
|
# <<: *backend-image
|
2024-12-19 17:45:13 +07:00
|
|
|
# container_name: lago-webhook-worker
|
|
|
|
# restart: unless-stopped
|
|
|
|
# depends_on:
|
|
|
|
# api:
|
|
|
|
# condition: service_healthy
|
|
|
|
# command: ["./scripts/start.webhook.worker.sh"]
|
|
|
|
# environment:
|
2025-01-30 18:22:19 +07:00
|
|
|
# <<: [*backend-env, *lago-api-url]
|
2024-12-05 22:55:24 +07:00
|
|
|
|
2022-04-11 22:57:34 +07:00
|
|
|
api-clock:
|
2025-01-30 18:22:19 +07:00
|
|
|
<<: *backend-image
|
2022-04-11 22:57:34 +07:00
|
|
|
container_name: lago-clock
|
|
|
|
restart: unless-stopped
|
|
|
|
depends_on:
|
2025-01-21 23:36:24 +07:00
|
|
|
migrate:
|
|
|
|
condition: service_completed_successfully
|
|
|
|
db:
|
2024-02-01 14:31:25 +07:00
|
|
|
condition: service_healthy
|
2025-01-21 23:36:24 +07:00
|
|
|
restart: true
|
|
|
|
redis:
|
|
|
|
condition: service_healthy
|
|
|
|
restart: true
|
2025-01-14 22:40:29 +07:00
|
|
|
command: ["./scripts/start.clock.sh"]
|
2022-04-11 22:57:34 +07:00
|
|
|
environment:
|
2025-01-30 18:22:19 +07:00
|
|
|
<<: [*backend-env, *lago-api-url]
|
2022-07-05 20:31:37 +07:00
|
|
|
|
|
|
|
pdf:
|
2024-01-22 22:09:03 +07:00
|
|
|
image: getlago/lago-gotenberg:7.8.2
|