frontend docker refactor

This commit is contained in:
fred 2026-01-28 13:17:57 -08:00
parent 63e33a45b4
commit 8c7fb8c6bf
8 changed files with 30 additions and 30 deletions

View file

@ -1,13 +1,15 @@
FROM node:22-alpine
FROM node:22-alpine AS builder
WORKDIR /usr/src/app
WORKDIR /app
COPY package*.json tsconfig*.json postcss.config.js tailwind.config.js eslint.config.js vite.config.ts index.html ./
COPY src ./src
COPY package*.json ./
RUN apk update && apk upgrade
RUN npm install
RUN npm run build
RUN if [ "$NODE_ENV" = "dev" ]; then npm install; else npm install --omit=dev; fi
COPY . .
FROM caddy:2.10
COPY Caddyfile /etc/caddy/Caddyfile
COPY --from=builder /app/dist /srv
EXPOSE 80
CMD npm run $NODE_ENV