From d07887ad7d862ad9f4d7c8988e8b1fc8cf4e8f52 Mon Sep 17 00:00:00 2001 From: Vincent Pochet Date: Tue, 10 May 2022 14:45:15 +0200 Subject: [PATCH] fix: #18 Fix cors issue for production environment (#19) --- .github/workflows/deploy-preview.yml | 1 + docker-compose.dev.yml | 1 + docker-compose.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index b2cdefe..cc255e5 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -134,6 +134,7 @@ jobs: env: RAILS_ENV: staging API_URL: https://${{ github.event.inputs.preview_name }}-api.staging.getlago.com + LAGO_FRONT_URL: https://${{ github.event.inputs.preview_name }}-app.staging.getlago.com with: context: ./api push: true diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 8c046bb..ed8aa38 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -88,6 +88,7 @@ services: - 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_FRONT_URL=${FRONT_URL:-https://app.lago.dev} labels: - "traefik.enable=true" - "traefik.http.routers.api_http.rule=Host(`api.lago.dev`)" diff --git a/docker-compose.yml b/docker-compose.yml index bc40485..49e0ad6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -42,6 +42,7 @@ services: - SECRET_KEY_BASE=${SECRET_KEY_BASE:-your-secret-key-base-hex-64} - RAILS_ENV=production - SENTRY_DSN=${SENTRY_DSN} + - LAGO_FRONT_URL"${FRONT_URL:-http://localhost} ports: - ${API_PORT:-3000}:3000