chore: Dockerize method

This commit is contained in:
2025-10-07 08:03:28 +05:45
parent be4db34031
commit 4b1ada1fa8
5 changed files with 61 additions and 0 deletions

31
Dockerfile Normal file
View File

@@ -0,0 +1,31 @@
# Stage 1: Build the app
FROM node:20-alpine AS builder
# Create and set working directory
WORKDIR /app
# Copy package files and install dependencies
COPY package*.json ./
RUN npm ci
# Copy the rest of the project files
COPY . .
# Build the SvelteKit app
RUN npm run build
# Stage 2: Run the app
FROM node:20-alpine
WORKDIR /app
# Copy only necessary files from builder stage
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/build ./build
COPY --from=builder /app/node_modules ./node_modules
# Expose the port that your app runs on
EXPOSE 3000
# Start the SvelteKit app
CMD ["node", "build"]