Files
dynamic-sites-simple/Dockerfile
2026-04-22 23:52:29 -05:00

38 lines
844 B
Docker

FROM node:22-alpine AS base
WORKDIR /app
# Install deps
COPY package.json package-lock.json* ./
COPY shared/package.json shared/
COPY server/package.json server/
RUN npm install --ignore-scripts
# Copy source
COPY . .
# Build
RUN npm run build
# Production
FROM node:22-alpine AS runtime
WORKDIR /app
COPY --from=base /app/node_modules ./node_modules
COPY --from=base /app/shared ./shared
COPY --from=base /app/dist ./dist
COPY --from=base /app/package.json ./
COPY --from=base /app/site-context.json ./
COPY --from=base /app/content ./content
COPY --from=base /app/content ./content-seed
COPY --from=base /app/config ./config
COPY --from=base /app/server/entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
ENV HOST=0.0.0.0
ENV PORT=4321
EXPOSE 4321
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["node", "dist/server/entry.mjs"]