Skip to content

Commit 1a275cd

Browse files
committed
dockerfile nginx 설정 변경
1 parent f46b04a commit 1a275cd

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ RUN npm install
66
COPY . ./
77
RUN npm run build
88

9-
# 빌드된 정적 파일을 호스트 서버의 `/var/www/html`로 복사
10-
FROM alpine:latest
11-
WORKDIR /app
12-
COPY --from=build /app/dist /var/www/html
9+
# 2️⃣ Production 단계 (Nginx를 사용해 정적 파일 서빙)
10+
FROM nginx:1.23-alpine
11+
COPY --from=builder /app/build /usr/share/nginx/html
12+
13+
# Nginx 설정 추가 (캐싱 설정 및 gzip 활성화)
14+
COPY nginx.conf /etc/nginx/conf.d/default.conf
1315

1416
# 🚀 컨테이너를 계속 유지하도록 추가
15-
CMD ["tail", "-f", "/dev/null"]
17+
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)