thomaswilson-sveltekit/web.Dockerfile

30 lines
731 B
Docker
Raw Normal View History

2026-02-21 07:51:17 +00:00
# Use a Node.js Alpine image for the builder stage
FROM node:24-alpine AS builder
WORKDIR /app
COPY package*.json ./
COPY pnpm-lock.yaml ./
COPY pnpm-workspace.yaml ./
2026-02-21 07:51:17 +00:00
ENV CI=true
RUN npm i -g pnpm
RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm build
RUN pnpm prune --prod
# Use another Node.js Alpine image for the final stage
FROM node:24-alpine
WORKDIR /app
2026-03-01 22:14:22 +00:00
COPY ./scripts/entrypoint.sh entrypoint.sh
RUN chmod +x entrypoint.sh
2026-02-21 07:51:17 +00:00
COPY --from=builder /app/build build/
2026-03-01 22:14:22 +00:00
COPY --from=builder /app/prisma prisma/
COPY --from=builder /app/prisma.config.ts prisma.config.ts
2026-02-21 07:51:17 +00:00
COPY --from=builder /app/node_modules node_modules/
2026-02-21 07:51:17 +00:00
COPY package.json .
EXPOSE 3000
ENV NODE_ENV=production
2026-03-01 08:52:30 +00:00
VOLUME /data
ENTRYPOINT [ "./entrypoint.sh" ]