-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (24 loc) · 750 Bytes
/
Copy pathDockerfile
File metadata and controls
34 lines (24 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Use Node 18 Alpine for smaller image size
FROM node:18-alpine
# Install pnpm
RUN corepack enable && corepack prepare pnpm@latest --activate
# Install dependencies for building native modules and curl for health checks
RUN apk add --no-cache python3 make g++ curl
# Set working directory
WORKDIR /app
# Copy package.json and pnpm-lock.yaml
COPY ./package.json ./pnpm-lock.yaml ./
# Install all dependencies using pnpm
RUN pnpm install --frozen-lockfile
# Copy all source files
COPY . .
# Build the application
RUN pnpm run build
# Expose port (default SvelteKit port)
EXPOSE 3000
# Set environment variables for runtime
ENV NODE_ENV=production
ENV PORT=3000
ENV HOST=0.0.0.0
# Start the application using node adapter
CMD ["node", "build"]