add Dockerfile
This commit is contained in:
32
Dockerfile
Normal file
32
Dockerfile
Normal file
@@ -0,0 +1,32 @@
|
||||
# Stage 1: Build the app
|
||||
FROM node:24 AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install pnpm globally
|
||||
RUN npm install pnpm --global
|
||||
|
||||
# Copy relevant files
|
||||
COPY pnpm-workspace.yaml ./
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
COPY packages/ ./packages/
|
||||
COPY website/package.json ./website/
|
||||
COPY website/ ./website/
|
||||
COPY jsdoc/ ./jsdoc/
|
||||
COPY my-patterns/ ./my-patterns/
|
||||
|
||||
# Install dependencies and build production assets
|
||||
RUN pnpm install
|
||||
RUN pnpm build
|
||||
|
||||
# Stage 2: Serve the built app using nginx
|
||||
FROM nginx:alpine AS production
|
||||
|
||||
# Copy built static files from builder stage
|
||||
COPY --from=builder /app/website/dist /usr/share/nginx/html
|
||||
|
||||
# Expose port 80
|
||||
EXPOSE 80
|
||||
|
||||
# Start nginx service
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user