This commit is contained in:
backuppc
2026-01-16 14:54:33 +09:00
parent e54a8b2a29
commit 71f119414f
2 changed files with 31 additions and 37 deletions

View File

@@ -1,27 +1,16 @@
# Build stage # 1단계: 빌드 (Node.js)
FROM node:20-alpine as build FROM node:20-alpine AS build
WORKDIR /app WORKDIR /app
# Copy package files and install dependencies
COPY package*.json ./ COPY package*.json ./
RUN npm install RUN npm install
# Copy source code and build
COPY . . COPY . .
RUN npm run build RUN npm run build
# Production stage # 2단계: 실행 (Nginx)
FROM nginx:alpine FROM nginx:stable-alpine
# 빌드된 파일들을 Nginx의 기본 경로로 복사
# Remove default nginx static assets COPY --from=build /app/dist /usr/share/nginx/html
RUN rm -rf /usr/share/nginx/html/* # (선택) 커스텀 nginx 설정을 넣고 싶다면 아래 주석 해제
# COPY nginx.conf /etc/nginx/conf.d/default.conf
# Copy built artifacts to /serial subdirectory to match base path
COPY --from=build /app/dist /usr/share/nginx/html/serial
# Copy custom nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80 EXPOSE 80
CMD ["nginx", "-g", "daemon off;"] CMD ["nginx", "-g", "daemon off;"]

View File

@@ -7,7 +7,12 @@ export default defineConfig(({ mode }) => {
return { return {
base: '/serial/', base: '/serial/',
server: { server: {
port: 3000, allowedHosts: ['app.tindevil.com', '*.tindevil.com'],
port: 4173,
host: '0.0.0.0',
},
preview: {
port: 4173,
host: '0.0.0.0', host: '0.0.0.0',
}, },
plugins: [react()], plugins: [react()],