31 lines
529 B
Docker
31 lines
529 B
Docker
FROM node:20-alpine
|
|
|
|
# Enable pnpm
|
|
RUN corepack enable && corepack prepare pnpm@latest --activate
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy files
|
|
COPY . .
|
|
|
|
# Install dependencies
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
# Build the SvelteKit app
|
|
RUN pnpm run build
|
|
|
|
# Expose default port
|
|
EXPOSE 3000
|
|
|
|
# Set environment
|
|
ENV NODE_ENV=production
|
|
|
|
# # add health check
|
|
# HEALTHCHECK --interval=30s --timeout=3s --retries=3 \
|
|
# CMD wget -qO- http://localhost:3000/_healthz || exit 1
|
|
|
|
|
|
# Start the SvelteKit app
|
|
CMD ["node", "build"]
|