Initial commit

This commit is contained in:
2026-01-31 11:19:41 +00:00
commit 8887106656
9 changed files with 1602 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
FROM mcr.microsoft.com/devcontainers/python:3.14
WORKDIR /workspace
CMD ["sleep", "infinity"]
+18
View File
@@ -0,0 +1,18 @@
{
"name": "Flask Dev Container",
"build": {
"dockerfile": "Dockerfile"
},
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"vivaxy.vscode-conventional-commits",
"esbenp.prettier-vscode"
]
}
},
"postCreateCommand": "pip install -r requirements.txt",
"forwardPorts": [5000],
"remoteUser": "vscode"
}
+2
View File
@@ -0,0 +1,2 @@
.devcontainer
deployment.yml
+33
View File
@@ -0,0 +1,33 @@
name: CI
on:
# push:
# branches: [ main ]
workflow_dispatch:
jobs:
build-and-push:
name: Build and Push
runs-on: build-htz-01
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build and push Docker image
run: |
docker build -t cr.jdbnet.co.uk/jdbnet/project:latest .
docker push cr.jdbnet.co.uk/jdbnet/project:latest
deploy:
name: Deploy to Kubernetes
needs: build-and-push
runs-on: k3s-internal-htz-01
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Apply manifests
run: |
sudo kubectl replace -f deployment.yml --grace-period=60 --force
+1
View File
@@ -0,0 +1 @@
__pycache__/
+6
View File
@@ -0,0 +1,6 @@
FROM python:3.14-slim
WORKDIR /app
COPY . /app
RUN pip install -r requirements.txt
EXPOSE 5000
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app", "--log-level", "warning"]
+53
View File
@@ -0,0 +1,53 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: project
namespace: project
spec:
replicas: 1
selector:
matchLabels:
app: project
template:
metadata:
labels:
app: project
spec:
containers:
- name: project
image: ghcr.io/jdb-net/project:latest
imagePullPolicy: Always
ports:
- containerPort: 5000
name: "project"
---
apiVersion: v1
kind: Service
metadata:
name: project-ingress-service
namespace: project
spec:
selector:
app: project
ports:
- protocol: TCP
port: 80
targetPort: 5000
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: project-ingress
namespace: project
spec:
rules:
- host: project.jdbnet.co.uk
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: project-ingress-service
port:
number: 80
+2
View File
@@ -0,0 +1,2 @@
Flask
gunicorn
File diff suppressed because it is too large Load Diff