From d052e464b27c55357e3ac625f81470e22c009920 Mon Sep 17 00:00:00 2001 From: br0kenpixel <23280129+br0kenpixel@users.noreply.github.com> Date: Thu, 4 Dec 2025 20:28:19 +0100 Subject: [PATCH] fix: update environment variables in docker-compose for better configurability --- docker/.env.example | 3 +++ docker/docker-compose.yml | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 docker/.env.example diff --git a/docker/.env.example b/docker/.env.example new file mode 100644 index 0000000..d9251f0 --- /dev/null +++ b/docker/.env.example @@ -0,0 +1,3 @@ +BACKEND_URL=backend.example.com +FRONTEND_URL=example.com +SESSION_DOMAIN=.example.com \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index b7a99ae..27fccb6 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -6,8 +6,8 @@ services: dockerfile: Dockerfile restart: unless-stopped environment: - NUXT_PUBLIC_SANCTUM_BASE_URL: https://backend.example.com - NUXT_PUBLIC_SANCTUM_ORIGINAL: https://example.com + NUXT_PUBLIC_SANCTUM_BASE_URL: ${BACKEND_URL:-https://backend.example.com} + NUXT_PUBLIC_SANCTUM_ORIGINAL: ${FRONTEND_URL:-https://example.com} ports: - 80:80 depends_on: @@ -30,10 +30,10 @@ services: APP_ENV: production APP_KEY: SOME-KEY APP_DEBUG: false - APP_URL: https://example.com - FRONTEND_URL: https://example.com - SANCTUM_STATEFUL_DOMAINS: backend.example.com,example.com - SESSION_DOMAIN: .example.com # Note the first dot + APP_URL: ${FRONTEND_URL:-https://example.com} + FRONTEND_URL: ${FRONTEND_URL:-https://example.com} + SANCTUM_STATEFUL_DOMAINS: ${BACKEND_URL:-https://backend.example.com},${FRONTEND_URL:-https://example.com} + SESSION_DOMAIN: ${SESSION_DOMAIN:-.example.com} # Note the first dot APP_LOCALE: sk APP_FALLBACK_LOCALE: en_US