Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Stage 1: Build the application
FROM node:18-alpine AS builder

# Set working directory
WORKDIR /app

# Copy package.json and package-lock.json
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application files
COPY . .

# Build the static site
RUN npm run docs:build

# Stage 2: Serve the application with Nginx
FROM nginx:alpine

# Copy the built static files from the builder stage
COPY --from=builder /app/.vitepress/dist /usr/share/nginx/html

# Expose port 80
EXPOSE 80

# Start Nginx
CMD ["nginx", "-g", "daemon off;"]
21 changes: 21 additions & 0 deletions k8s/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: cooklikehoc-deployment
labels:
app: cooklikehoc
spec:
replicas: 2
selector:
matchLabels:
app: cooklikehoc
template:
metadata:
labels:
app: cooklikehoc
spec:
containers:
- name: cooklikehoc
image: your-docker-registry/cooklikehoc:latest
ports:
- containerPort: 80
12 changes: 12 additions & 0 deletions k8s/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: cooklikehoc-service
spec:
selector:
app: cooklikehoc
ports:
- protocol: TCP
port: 80
targetPort: 80
type: LoadBalancer