Initial commit
This commit is contained in:
9
deploy/Dockerfile
Normal file
9
deploy/Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
||||
FROM docker.sciocatti.com/python-3.8-fastapi:0.0.1
|
||||
|
||||
WORKDIR /project
|
||||
COPY static/ static/
|
||||
COPY src/ src/
|
||||
COPY html/ html/
|
||||
COPY main.py main.py
|
||||
|
||||
CMD . /venv/bin/activate && cd /project && exec python main.py
|
||||
4
deploy/build.sh
Normal file
4
deploy/build.sh
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker build -f Dockerfile -t docker.sciocatti.com/template:0.0.1 .
|
||||
docker push docker.sciocatti.com/template:0.0.1
|
||||
72
deploy/deployment.yaml
Normal file
72
deploy/deployment.yaml
Normal file
@@ -0,0 +1,72 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: template
|
||||
namespace: development
|
||||
labels:
|
||||
app: template
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: template
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: template
|
||||
spec:
|
||||
nodeSelector:
|
||||
kubernetes.io/arch: amd64
|
||||
imagePullSecrets:
|
||||
- name: regcred
|
||||
restartPolicy: Always
|
||||
containers:
|
||||
- name: template
|
||||
image: docker.sciocatti.com/template:0.0.1
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 50001
|
||||
name: template-port
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: template-service
|
||||
namespace: development
|
||||
spec:
|
||||
selector:
|
||||
app: template
|
||||
ports:
|
||||
- name: template-port
|
||||
port: 3000
|
||||
targetPort: 50001
|
||||
protocol: TCP
|
||||
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: template-ingress
|
||||
namespace: development
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
traefik.ingress.kubernetes.io/router.entrypoints: web, websecure
|
||||
spec:
|
||||
rules:
|
||||
- host: template.sciocatti.com
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: template-service
|
||||
port:
|
||||
number: 3000
|
||||
tls:
|
||||
- hosts:
|
||||
- template.sciocatti.com
|
||||
secretName: template-sciocatti-com-tls
|
||||
36
deploy/requirements_fastapi_mac.txt
Normal file
36
deploy/requirements_fastapi_mac.txt
Normal file
@@ -0,0 +1,36 @@
|
||||
anyio==3.6.1
|
||||
asgiref==3.5.2
|
||||
certifi==2022.6.15
|
||||
charset-normalizer==2.0.12
|
||||
click==8.1.3
|
||||
dnspython==2.2.1
|
||||
email-validator==1.2.1
|
||||
fastapi==0.78.0
|
||||
h11==0.13.0
|
||||
httptools==0.4.0
|
||||
idna==3.3
|
||||
itsdangerous==2.1.2
|
||||
Jinja2==3.1.2
|
||||
MarkupSafe==2.1.1
|
||||
mysql-connector-python==8.0.31
|
||||
orjson==3.7.3
|
||||
protobuf==3.20.1
|
||||
pydantic==1.9.1
|
||||
PyMySQL==1.0.2
|
||||
python-dateutil==2.8.2
|
||||
python-dotenv==0.20.0
|
||||
python-multipart==0.0.5
|
||||
PyYAML==6.0
|
||||
requests==2.28.0
|
||||
six==1.16.0
|
||||
sniffio==1.2.0
|
||||
SQLAlchemy==1.4.42
|
||||
starlette==0.19.1
|
||||
typing_extensions==4.2.0
|
||||
ujson==5.3.0
|
||||
urllib3==1.26.9
|
||||
uvicorn==0.17.6
|
||||
uvloop==0.16.0
|
||||
watchgod==0.8.2
|
||||
websockets==10.3
|
||||
xmltodict==0.13.0
|
||||
3
deploy/run.sh
Normal file
3
deploy/run.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker run -it --rm -p 64000:50001 -v $(pwd):/project docker.sciocatti.com/python-3.8-fastapi:0.0.1 bash -c 'cd /project && . /venv/bin/activate && exec python main.py'
|
||||
Reference in New Issue
Block a user