init
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
# 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 /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 .
|
||||
Reference in New Issue
Block a user