Skip to content

Commit

Permalink
add dockerfile and kubernetes file
Browse files Browse the repository at this point in the history
  • Loading branch information
agarwalhimanshugaya committed Jul 22, 2024
1 parent 3e85c84 commit 1459c66
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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;"]
19 changes: 19 additions & 0 deletions deployment.yaml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions service.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1459c66

Please sign in to comment.