generated from fahricansecer/boilerplate-fe
All checks were successful
HarunCAN Studio FE Deploy 🎨 / build-and-deploy (push) Successful in 41s
19 lines
487 B
Docker
19 lines
487 B
Docker
# --- 1. Build Katmanı ---
|
||
FROM node:20-alpine AS builder
|
||
WORKDIR /app
|
||
COPY package.json package-lock.json ./
|
||
RUN npm ci
|
||
COPY . .
|
||
|
||
# Build-time env (vite.config.ts'de kullanılıyor)
|
||
ARG GEMINI_API_KEY
|
||
ENV GEMINI_API_KEY=$GEMINI_API_KEY
|
||
|
||
RUN npm run build
|
||
|
||
# --- 2. Production Katmanı (Nginx ile statik serve) ---
|
||
FROM nginx:alpine AS runner
|
||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||
EXPOSE 80
|
||
CMD ["nginx", "-g", "daemon off;"] |