Skip to content

Commit 32db2fd

Browse files
Merge pull request #89 from SSASINSA/refactor/sprint-fix(#68)
#68/nginx 통합 작업
2 parents 0f0877d + 7888d99 commit 32db2fd

File tree

2 files changed

+16
-24
lines changed

2 files changed

+16
-24
lines changed

Dockerfile

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
# ---------- 1단계: 빌드 단계 ----------
22
FROM node:20-alpine AS build
33
WORKDIR /app
4-
4+
55
COPY package.json package-lock.json ./
66
RUN npm ci
7-
7+
88
COPY . .
9-
10-
RUN npm run build
11-
12-
9+
10+
RUN PUBLIC_URL=. npm run build
11+
12+
1313
# ---------- 2단계: 런타임(서빙) 단계 ----------
14-
FROM nginx:alpine
15-
WORKDIR /usr/share/nginx/html
16-
17-
COPY docker/frontend-nginx.conf /etc/nginx/conf.d/default.conf
18-
19-
COPY --from=build /app/build ./
20-
14+
FROM node:20-alpine AS runner
15+
WORKDIR /app
16+
17+
# 정적 파일 서빙용 (nginx 제거)
18+
RUN npm i -g serve
19+
20+
COPY --from=build /app/build ./build
21+
2122
EXPOSE 80
22-
CMD ["nginx", "-g", "daemon off;"]
23+
CMD ["serve", "-s", "build", "-l", "80"]
24+

docker/frontend-nginx.conf

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)