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

32 lines
739 B
Docker

FROM node:20.19-alpine AS build
WORKDIR /app
RUN corepack enable
COPY package.json pnpm-lock.yaml .npmrc ./
RUN pnpm install --frozen-lockfile
COPY . .
ARG VITE_BASE_URL=/
ARG VITE_APP_BASE_API=/api/v1
ARG VITE_APP_WS_ENDPOINT=
ENV VITE_BASE_URL=${VITE_BASE_URL} \
VITE_APP_BASE_API=${VITE_APP_BASE_API} \
VITE_APP_WS_ENDPOINT=${VITE_APP_WS_ENDPOINT}
RUN pnpm run build
FROM nginx:1.25-alpine AS runtime
ENV BACKEND_UPSTREAM=http://fastapiadmin-backend:8001
COPY nginx/default.conf.template /etc/nginx/templates/default.conf.template
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget -q --spider http://127.0.0.1/ || exit 1