Spaces:
Sleeping
Sleeping
File size: 874 Bytes
3c56493 5d50825 3c56493 5d50825 3c56493 5d50825 3c56493 5d50825 3c56493 5d50825 3c56493 c95ede1 3c56493 | 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 35 36 37 38 39 | # Use a Node.js Slim image for the builder stage
FROM node:24.0.1-slim AS builder
# Set the working directory
WORKDIR /app
# Copy package files and install dependencies
COPY package*.json ./
RUN npm ci
# Copy the rest of the source files and build the SvelteKit app
COPY . .
RUN npm run build
# Prune dependencies to production-only
RUN npm prune --production
# Use another Node.js Slim image for the final stage
FROM node:24.0.1-slim AS runner
# Set the working directory
WORKDIR /app
# Copy the built app and production node_modules from the builder stage
COPY --from=builder /app/build build/
COPY --from=builder /app/node_modules node_modules/
COPY package.json .
# Expose the port the app runs on
EXPOSE 7860
# Set the environment to production
ENV NODE_ENV=production
ENV PORT=7860
ENV HOST=0.0.0.0
# Specify the command to run the app
CMD ["node", "build"]
|