feat: add container file
- update README.md for containerization
This commit is contained in:
22
Containerfile
Normal file
22
Containerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
# Stage 1: Build
|
||||
FROM node:20-alpine AS builder
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
RUN npm prune --production
|
||||
|
||||
# Stage 2: Run
|
||||
FROM node:20-alpine
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/build ./build
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY package.json .
|
||||
|
||||
# Default SvelteKit production port
|
||||
ENV PORT=3000
|
||||
EXPOSE 3000
|
||||
|
||||
# Start the app
|
||||
CMD ["node", "build"]
|
||||
Reference in New Issue
Block a user