Files
librodrome/docker/Dockerfile
Yann Autissier a2787c9897
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
fix docker build
2026-02-25 02:15:23 +01:00

44 lines
772 B
Docker

# syntax = docker/dockerfile:1
ARG NODE_VERSION=23.11.0-slim
FROM node:${NODE_VERSION} AS base
ARG PORT=3000
WORKDIR /src
# Build
FROM base AS build
COPY package.json pnpm-lock.yaml ./
RUN npm install
RUN npm rebuild sharp
COPY . .
RUN npm run build
# Production
FROM base AS production
ENV PORT=${PORT}
ENV NODE_ENV=production
COPY --from=build /src/.output /src/.output
COPY --from=build /src/site /src/site
RUN apt-get update && apt-get install curl && rm -rf /var/cache/apt/*
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD curl -f http://localhost:${PORT}/api/health || exit 1
EXPOSE $PORT
CMD [ "node", ".output/server/index.mjs" ]
# Development
FROM base AS development
WORKDIR /app
ENTRYPOINT [ "npm", "run", "dev" ]