-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
60 lines (46 loc) · 1.23 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# 빌드 단계
FROM node:18.19-alpine AS builder
# 작업 디렉토리 설정
WORKDIR /app
# 필요한 시스템 패키지 설치
RUN apk add --no-cache libc6-compat build-base python3
# 환경 변수 설정
ARG VITE_SERVER_BASE_URL
ARG VITE_SERVER_SOCKET_URL
ARG CHANNEL_TALK_PLUGIN_KEY
ARG VITE_SERVER_GRAFANA_URL
ENV VITE_SERVER_BASE_URL=${VITE_SERVER_BASE_URL} \
VITE_SERVER_SOCKET_URL=${VITE_SERVER_SOCKET_URL} \
CHANNEL_TALK_PLUGIN_KEY=${CHANNEL_TALK_PLUGIN_KEY} \
VITE_SERVER_GRAFANA_URL=${VITE_SERVER_GRAFANA_URL}
# Zero Install 파일 복사
COPY .yarn ./.yarn
COPY .yarnrc.yml ./
COPY .pnp.cjs ./
COPY package.json ./
# 의존성 설치
COPY . .
RUN yarn install && yarn build
# 실행 단계
FROM nginx:alpine AS runner
# 작업 디렉토리 설정
WORKDIR /usr/share/nginx/html
# 빌드된 결과물 복사
COPY --from=builder /app/dist ./
# Nginx 설정 복사 및 설정 최적화
COPY <<EOF /etc/nginx/conf.d/default.conf
server {
listen 3000;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html;
try_files \$uri /index.html;
}
error_page 404 /index.html;
}
EOF
# 포트 노출
EXPOSE 3000
# Nginx 실행
CMD ["nginx", "-g", "daemon off;"]