From 2aff11bc5d14edd621ea5ab3c988845da7bc27ce Mon Sep 17 00:00:00 2001 From: chan Date: Thu, 15 Jan 2026 14:15:39 +0900 Subject: [PATCH] =?UTF-8?q?front=20env=20=EC=A2=85=EC=86=8D=EC=84=B1=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yaml | 14 ++++++++++++++ frontend/.env.sample | 34 ---------------------------------- frontend/Dockerfile | 1 + 3 files changed, 15 insertions(+), 34 deletions(-) delete mode 100644 frontend/.env.sample diff --git a/docker-compose.yaml b/docker-compose.yaml index 849de395..18eb507f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -10,6 +10,7 @@ services: - .env environment: - APP_ENV=${APP_ENV:-development} + - GO_ENV=${APP_ENV:-development} - COOKIE_SECRET=${COOKIE_SECRET} - JWT_SECRET=${JWT_SECRET} - DESCOPE_PROJECT_ID=${DESCOPE_PROJECT_ID} @@ -39,14 +40,27 @@ services: context: ./frontend dockerfile: Dockerfile container_name: baron_frontend + env_file: + - .env environment: - DESCOPE_PROJECT_ID=${DESCOPE_PROJECT_ID} + - BACKEND_URL=${BACKEND_URL} + - FRONTEND_URL=${FRONTEND_URL} + - APP_ENV=${APP_ENV} ports: - "${FRONTEND_PORT:-5000}:5000" networks: - baron_net depends_on: - backend + command: > + /bin/sh -c "mkdir -p /usr/share/nginx/html/assets && + echo \"DESCOPE_PROJECT_ID=$${DESCOPE_PROJECT_ID}\" > /usr/share/nginx/html/assets/.env && + echo \"BACKEND_URL=$${BACKEND_URL}\" >> /usr/share/nginx/html/assets/.env && + echo \"FRONTEND_URL=$${FRONTEND_URL}\" >> /usr/share/nginx/html/assets/.env && + echo \"APP_ENV=$${APP_ENV}\" >> /usr/share/nginx/html/assets/.env && + cp /usr/share/nginx/html/assets/.env /usr/share/nginx/html/.env && + nginx -g 'daemon off;'" # Dummy service to wait for infra network if needed, # but essentially we assume infra is running. diff --git a/frontend/.env.sample b/frontend/.env.sample deleted file mode 100644 index 1a40fcee..00000000 --- a/frontend/.env.sample +++ /dev/null @@ -1,34 +0,0 @@ -# ========================================== -# Baron SSO - Unified Environment Configuration -# ========================================== - -# --- General System --- -APP_ENV=development -TZ=Asia/Seoul - -# --- Infrastructure Ports --- -DB_PORT=5432 -CLICKHOUSE_PORT_HTTP=8123 -CLICKHOUSE_PORT_NATIVE=9000 -BACKEND_PORT=3000 -FRONTEND_PORT=5000 - -# --- Database Credentials (PostgreSQL) --- -DB_USER=baron -DB_PASSWORD=password -DB_NAME=baron_sso - -# --- Backend Configuration --- -# Must be 32 bytes. Generate with `openssl rand -hex 32` -COOKIE_SECRET=super-secret-key-must-be-32-bytes! -REDIS_ADDR=redis:6379 - -# --- Frontend Configuration --- -# Descope Project ID (Required for Auth) -DESCOPE_PROJECT_ID=P2t...your_descope_project_id - -# --- Naver Cloud Services --- -NAVER_CLOUD_ACCESS_KEY=ncp_iam_... -NAVER_CLOUD_SECRET_KEY=ncp_iam_... -NAVER_CLOUD_SERVICE_ID=ncp:sms:kr:...:... -NAVER_SENDER_PHONE_NUMBER=... diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 5b420d61..0483df6f 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -4,6 +4,7 @@ WORKDIR /app COPY . . # Get dependencies and build for web RUN flutter pub get +RUN touch .env RUN flutter build web --release # Stage 2: Serve with Nginx