feat: frontend 이미지 생성을 위한 Dockerfile 및 nginx 설정 추가

This commit is contained in:
이상진 2025-07-30 15:45:35 +09:00
parent 526598a24f
commit 0c83798b3f
3 changed files with 39 additions and 0 deletions

6
frontend/.dockerignore Normal file
View File

@ -0,0 +1,6 @@
node_modules
.git
.DS_Store
npm-debug.log
dist
build

18
frontend/Dockerfile Normal file
View File

@ -0,0 +1,18 @@
# Stage 1: Build the React app
FROM node:24 AS builder
WORKDIR /app
COPY package.json ./
COPY package-lock.json ./
RUN npm install --frozen-lockfile
COPY . .
RUN npm run build
# Stage 2: Serve with Nginx
FROM nginx:latest
COPY --from=builder /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

15
frontend/nginx.conf Normal file
View File

@ -0,0 +1,15 @@
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}