Skip to content

Commit e081985

Browse files
author
biljana-stanoevska-quipu
committed
docker and kubernetes test
1 parent dc7f4e9 commit e081985

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

app/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM python:3.10
2+
3+
RUN mkdir /app
4+
WORKDIR /app
5+
ADD . /app/
6+
RUN pip install -r requirements.txt
7+
8+
EXPOSE 5000
9+
CMD ["python", "/app/main.py"]

app/deployment.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: hello-python-service
5+
spec:
6+
selector:
7+
app: hello-python
8+
ports:
9+
- protocol: "TCP"
10+
port: 6001
11+
targetPort: 5000
12+
type: LoadBalancer
13+
14+
---
15+
apiVersion: apps/v1
16+
kind: Deployment
17+
metadata:
18+
name: hello-python
19+
spec:
20+
selector:
21+
matchLabels:
22+
app: hello-python
23+
replicas: 4
24+
template:
25+
metadata:
26+
labels:
27+
app: hello-python
28+
spec:
29+
containers:
30+
- name: hello-python
31+
image: hello-python:latest
32+
imagePullPolicy: Never
33+
ports:
34+
- containerPort: 5000

0 commit comments

Comments
 (0)