Skip to content

Commit bd8333f

Browse files
committed
fix: Docker 환경에 맞게 API_PREFIX 수정
1 parent a552669 commit bd8333f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

frontend/constants/api.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || "/api";
1+
const API_BASE_URL =
2+
typeof window === "undefined"
3+
? process.env.INTERNAL_API_URL
4+
: process.env.NEXT_PUBLIC_API_URL;
25

36
export const API_PREFIX =
47
process.env.NEXT_PUBLIC_API_MODE === "mock"

frontend/docker-compose.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
version: '3.8'
1+
version: "3.8"
22

33
services:
44
frontend:
55
build:
66
context: ..
77
dockerfile: frontend/Dockerfile
88
ports:
9-
- '80:3000'
9+
- "80:3000"
1010
environment:
1111
- NODE_ENV=production
12+
- INTERNAL_API_URL=http://localhost:3000/api
1213
restart: unless-stopped
1314
networks:
1415
- app-network

0 commit comments

Comments
 (0)