added dockerfile for docs
This commit is contained in:
2
apps/docs/.dockerignore
Normal file
2
apps/docs/.dockerignore
Normal file
@@ -0,0 +1,2 @@
|
||||
node_modules
|
||||
dist
|
||||
32
apps/docs/Dockerfile
Normal file
32
apps/docs/Dockerfile
Normal file
@@ -0,0 +1,32 @@
|
||||
# --- Build stage ---
|
||||
FROM node:24-alpine3.21 AS builder
|
||||
# Consider using the latest patch version for security updates
|
||||
RUN apk update && apk upgrade
|
||||
|
||||
# Install pnpm
|
||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
RUN apk add --no-cache git
|
||||
|
||||
# Set workdir
|
||||
WORKDIR /app
|
||||
|
||||
# Copy project files
|
||||
COPY ./apps/docs .
|
||||
|
||||
# Install dependencies
|
||||
RUN pnpm install
|
||||
|
||||
# Build VitePress site
|
||||
RUN pnpm build
|
||||
|
||||
# --- Serve stage ---
|
||||
FROM nginx:alpine
|
||||
|
||||
# Copy built site to nginx public folder
|
||||
COPY --from=builder /app/.vitepress/dist /usr/share/nginx/html
|
||||
|
||||
# Expose port
|
||||
EXPOSE 80
|
||||
|
||||
# Start nginx
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user