diff --git a/.gitignore b/.gitignore index 5f1ef7f95..6b96682cb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ *.code-workspace .env .DS_Store +.vscode /extra/ssl/certbot /extra/ssl/nginx* /extra/ssl/dhparam.pem diff --git a/api b/api index 979db6f3c..31a2dd2de 160000 --- a/api +++ b/api @@ -1 +1 @@ -Subproject commit 979db6f3cc5fbccafe214f010789b373d3377093 +Subproject commit 31a2dd2def73bf81be7aad12a18934dab89fa2a1 diff --git a/docker-compose.arm64.yml b/docker-compose.arm64.yml new file mode 100644 index 000000000..4246c0ff8 --- /dev/null +++ b/docker-compose.arm64.yml @@ -0,0 +1,151 @@ +version: "3.8" + +volumes: + lago_postgres_data: + lago_redis_data: + +services: + db: + image: postgres:14.0-alpine + container_name: lago-db + restart: unless-stopped + environment: + POSTGRES_DB: ${POSTGRES_DB:-lago} + POSTGRES_USER: ${POSTGRES_USER:-lago} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme} + PGDATA: /data/postgres + volumes: + - lago_postgres_data:/data/postgres + ports: + - ${POSTGRES_PORT:-5432}:5432 + + redis: + image: redis:6.2-alpine + container_name: lago-redis + restart: unless-stopped + volumes: + - lago_redis_data:/data + ports: + - ${REDIS_PORT:-6379}:6379 + + api: + container_name: lago-api + image: getlago/api-arm64v8:v0.8.0-alpha + restart: unless-stopped + depends_on: + - db + - redis + command: ["./scripts/start.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} + - REDIS_URL=redis://${REDIS_HOST:-redis}:${REDIS_PORT:-6379} + - SECRET_KEY_BASE=${SECRET_KEY_BASE:-your-secret-key-base-hex-64} + - RAILS_ENV=production + - SENTRY_DSN=${SENTRY_DSN} + - LAGO_FRONT_URL=${LAGO_FRONT_URL:-http://localhost} + - RSA_PRIVATE_KEY=${LAGO_RSA_PRIVATE_KEY} # Should be base64 encoded + - LAGO_RSA_PRIVATE_KEY=${LAGO_RSA_PRIVATE_KEY} # Should be base64 encoded + - LAGO_SIDEKIQ_WEB=${LAGO_SIDEKIQ_WEB} + - ENCRYPTION_PRIMARY_KEY=${LAGO_ENCRYPTION_PRIMARY_KEY:-your-encrpytion-primary-key} + - ENCRYPTION_DETERMINISTIC_KEY=${LAGO_ENCRYPTION_DETERMINISTIC_KEY:-your-encrpytion-deterministic-key} + - ENCRYPTION_KEY_DERIVATION_SALT=${LAGO_ENCRYPTION_KEY_DERIVATION_SALT:-your-encrpytion-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_PDF_URL=${LAGO_PDF_URL:-http://pdf:3000} + - LAGO_REDIS_CACHE_URL=redis://${LAGO_REDIS_CACHE_HOST:-redis}:${LAGO_REDIS_CACHE_PORT:-6379} + - LAGO_DISABLE_SEGMENT=${LAGO_DISABLE_SEGMENT} + ports: + - ${API_PORT:-3000}:3000 + + front: + container_name: lago-front + image: getlago/front-arm64v8:v0.8.0-alpha + restart: unless-stopped + # 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;\"'" + depends_on: + - api + environment: + - API_URL=${LAGO_API_URL:-http://localhost:3000} + - APP_ENV=${APP_ENV:-production} + - CODEGEN_API=${LAGO_API_URL:-http://localhost:3000} + - LAGO_DISABLE_SIGNUP=${LAGO_DISABLE_SIGNUP} + ports: + - ${FRONT_PORT:-80}:80 + - 443:443 + # 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 + certbot: + image: certbot/certbot:arm64v8-latest + 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 + + api-worker: + container_name: lago-worker + image: getlago/api-arm64v8:v0.8.0-alpha + restart: unless-stopped + depends_on: + - api + command: ["./scripts/start.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} + - REDIS_URL=redis://${REDIS_HOST:-redis}:${REDIS_PORT:-6379} + - SECRET_KEY_BASE=${SECRET_KEY_BASE:-your-secret-key-base-hex-64} + - RAILS_ENV=production + - 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 + - ENCRYPTION_PRIMARY_KEY=${LAGO_ENCRYPTION_PRIMARY_KEY:-your-encrpytion-primary-key} + - ENCRYPTION_DETERMINISTIC_KEY=${LAGO_ENCRYPTION_DETERMINISTIC_KEY:-your-encrpytion-deterministic-key} + - ENCRYPTION_KEY_DERIVATION_SALT=${LAGO_ENCRYPTION_KEY_DERIVATION_SALT:-your-encrpytion-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_PDF_URL=${LAGO_PDF_URL:-http://pdf:3000} + - LAGO_REDIS_CACHE_URL=redis://${LAGO_REDIS_CACHE_HOST:-redis}:${LAGO_REDIS_CACHE_PORT:-6379} + - LAGO_DISABLE_SEGMENT=${LAGO_DISABLE_SEGMENT} + + api-clock: + container_name: lago-clock + image: getlago/api-arm64v8:v0.8.0-alpha + restart: unless-stopped + depends_on: + - api + command: ["./scripts/start.clock.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} + - REDIS_URL=redis://${REDIS_HOST:-redis}:${REDIS_PORT:-6379} + - SECRET_KEY_BASE=${SECRET_KEY_BASE:-your-secret-key-base-hex-64} + - RAILS_ENV=production + - 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 + - ENCRYPTION_PRIMARY_KEY=${LAGO_ENCRYPTION_PRIMARY_KEY:-your-encrpytion-primary-key} + - ENCRYPTION_DETERMINISTIC_KEY=${LAGO_ENCRYPTION_DETERMINISTIC_KEY:-your-encrpytion-deterministic-key} + - ENCRYPTION_KEY_DERIVATION_SALT=${LAGO_ENCRYPTION_KEY_DERIVATION_SALT:-your-encrpytion-derivation-salt} + + pdf: + image: getlago/lago-gotenberg:7 diff --git a/front b/front index b140f6251..f82976e99 160000 --- a/front +++ b/front @@ -1 +1 @@ -Subproject commit b140f62516f1cab9824d57d34a0f77193bf4238a +Subproject commit f82976e9960eeea0eae5f4f05535ee5e17666507