You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

37 lines
873 B

# syntax=docker/dockerfile:1.7
FROM node:22-alpine AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm install
FROM node:22-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
ARG VITE_USE_MOCK_DATA=false
ARG VITE_API_BASE_URL=/api/shop
ARG VITE_MEDIA_ORIGIN=
ENV VITE_USE_MOCK_DATA=$VITE_USE_MOCK_DATA
ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
ENV VITE_MEDIA_ORIGIN=$VITE_MEDIA_ORIGIN
ENV NODE_ENV=production
RUN npm run build
FROM nginx:1.27-alpine AS runner
RUN apk add --no-cache wget
COPY nginx.staging.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget -qO- http://127.0.0.1:3000/healthz || exit 1
CMD ["nginx", "-g", "daemon off;"]