diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9424d1e --- /dev/null +++ b/Dockerfile @@ -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;"] \ No newline at end of file diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml new file mode 100644 index 0000000..ba7332d --- /dev/null +++ b/k8s/deployment.yaml @@ -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 \ No newline at end of file diff --git a/k8s/service.yaml b/k8s/service.yaml new file mode 100644 index 0000000..d3bb4fc --- /dev/null +++ b/k8s/service.yaml @@ -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 \ No newline at end of file