Skip to content

Commit

Permalink
build : dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeyo03 authored Nov 1, 2024
1 parent 1d82871 commit 2443667
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,24 @@ ARG VITE_KAKAO_REST_API_KEY

# Install dependencies
WORKDIR /app
COPY package.json package-lock.json* ./

COPY package.json package-lock.json*./
RUN npm ci # package 설치

# Copy source code and set environment variables
COPY . .
ENV VITE_KAKAO_MAP_KEY=${VITE_KAKAO_MAP_KEY}
ENV VITE_KAKAO_REST_API_KEY=${VITE_KAKAO_REST_API_KEY}

# Build the Vite application
RUN vite build
RUN npm run build # npm run build 명령어로 vite 실행

# Nginx server to serve static files
FROM nginx:stable-alpine AS runner

# Copy nginx configuration (optional, if you have a custom config)
COPY nginx/nginx.conf /etc/nginx/nginx.conf

# Copy built files to Nginx for serving
COPY --from=base /app/dist /usr/share/nginx/html

Expand Down

0 comments on commit 2443667

Please sign in to comment.