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.

22 lines
788 B
Docker

# adapted from example on pnpm.io
FROM node:20-slim AS build
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /app
# copy what's necessary to install dependencies:
COPY package.json pnpm-lock.yaml /app/
# install dependencies:
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
# copy what's necessary to build:
COPY tsconfig.json vite.config.ts index.html index.css postcss.config.js tailwind.config.js /app/
COPY src /app/src
# Vite injects envvars at build time, not runtime:
ENV VITE_SERVER_BASE_URL=https://calendar-optimizer-server.sakal.us
# run the build:
RUN pnpm run build
# hack to get spa-to-http to answer `/healthz` query:
RUN echo OK > ./dist/healthz
FROM devforth/spa-to-http:latest
COPY --from=build /app/dist .