diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d9f23af --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +# Use the official nginx image as the base image +FROM nginx:alpine + +# Copy the HTML, CSS, and JavaScript files into the container +COPY ./ /usr/share/nginx/html + +# Expose port 80 +EXPOSE 80 + +# Start nginx when the container launches +CMD ["nginx", "-g", "daemon off;"] diff --git a/deployment.yaml b/deployment.yaml new file mode 100644 index 0000000..21e723a --- /dev/null +++ b/deployment.yaml @@ -0,0 +1,19 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: static-web-app +spec: + replicas: 2 + selector: + matchLabels: + app: static-web-app + template: + metadata: + labels: + app: static-web-app + spec: + containers: + - name: static-web-app + image: your-image-name + ports: + - containerPort: 80 diff --git a/service.yaml b/service.yaml new file mode 100644 index 0000000..6cf4235 --- /dev/null +++ b/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: static-web-app-service +spec: + selector: + app: static-web-app + ports: + - protocol: TCP + port: 3000 + targetPort: 80 + type: LoadBalancer