pet-companion-front/Dockerfile

25 lines
676 B
Docker

# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# Production stage
FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
ENV VITE_API_BASE_URL=https://api.example.com
ENV VITE_FIREBASE_API_KEY=firebase-api
ENV VITE_FIREBASE_AUTH_DOMAIN=firebase-auth
ENV VITE_FIREBASE_PROJECT_ID=firebase-project
ENV VITE_FIREBASE_STORAGE_BUCKET=firebase-storage
ENV VITE_FIREBASE_MESSAGING_SENDER_ID=firebase-messaging
ENV VITE_FIREBASE_APP_ID=firebase-app
ENV VITE_FIREBASE_MEASUREMENT_ID=firebase-measurement
CMD ["nginx", "-g", "daemon off;"]