Skip to content

Commit 1b5ea28

Browse files
committed
chore: enhance Docker configuration by adding build arguments for VITE_API_URL and updating environment variables
1 parent 2d04845 commit 1b5ea28

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,15 @@ services:
4343
context: ./frontend
4444
dockerfile: Dockerfile
4545
target: production
46+
args:
47+
VITE_API_URL: ${VITE_API_URL}
4648
container_name: commitflow-ui
4749
restart: unless-stopped
4850
ports:
4951
- "${FE_PORT:-3000}:80"
5052
environment:
5153
- NODE_ENV=production
54+
# runtime env (optional, untuk entrypoint-based solution)
5255
- VITE_API_URL=${VITE_API_URL}
5356
- DISCORD_WEBHOOK_URL=${DISCORD_WEBHOOK_URL}
5457
- LOG_LEVEL=${LOG_LEVEL}

frontend/Dockerfile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,9 @@ RUN npm install
1818
# =========================
1919
FROM deps AS builder
2020

21-
# --- Tambahan ENV untuk Vite ---
2221
ARG VITE_API_URL
23-
ARG DISCORD_WEBHOOK_URL
24-
ARG LOG_LEVEL
2522

26-
ENV VITE_API_URL=$VITE_API_URL
27-
ENV DISCORD_WEBHOOK_URL=$DISCORD_WEBHOOK_URL
28-
ENV LOG_LEVEL=$LOG_LEVEL
29-
# --------------------------------
23+
ENV VITE_API_URL=${VITE_API_URL}
3024

3125
COPY . .
3226
RUN npm run build

0 commit comments

Comments
 (0)