Compare commits
2 Commits
d2b8d60598
...
30431709d3
| Author | SHA1 | Date | |
|---|---|---|---|
| 30431709d3 | |||
| e7d32152d5 |
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@@ -0,0 +1,14 @@
|
||||
FROM python:3.12-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY app.py .
|
||||
COPY templates ./templates
|
||||
COPY static ./static
|
||||
|
||||
EXPOSE 5000
|
||||
|
||||
CMD ["gunicorn", "-b", "0.0.0.0:5000", "app:app"]
|
||||
54
Jenkinsfile
vendored
Normal file
54
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
environment {
|
||||
REGISTRY = "gitea.yourdomain.com"
|
||||
IMAGE = "gitea.yourdomain.com/<username>/work-week-progress"
|
||||
TAG = "${env.BUILD_NUMBER}"
|
||||
}
|
||||
|
||||
stages {
|
||||
stage("Checkout") {
|
||||
steps {
|
||||
checkout scm
|
||||
}
|
||||
}
|
||||
|
||||
stage("Build Image") {
|
||||
steps {
|
||||
sh """
|
||||
docker build \
|
||||
-t ${IMAGE}:${TAG} \
|
||||
-t ${IMAGE}:latest \
|
||||
.
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
stage("Push Image") {
|
||||
steps {
|
||||
withCredentials([
|
||||
usernamePassword(
|
||||
credentialsId: 'gitea-registry-creds',
|
||||
usernameVariable: 'GITEA_USER',
|
||||
passwordVariable: 'GITEA_TOKEN'
|
||||
)
|
||||
]) {
|
||||
sh """
|
||||
echo "$GITEA_TOKEN" | docker login ${REGISTRY} \
|
||||
-u "$GITEA_USER" --password-stdin
|
||||
|
||||
docker push ${IMAGE}:${TAG}
|
||||
docker push ${IMAGE}:latest
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
cleanup {
|
||||
sh "docker image prune -f"
|
||||
}
|
||||
}
|
||||
}
|
||||
2
requirements.txt
Normal file
2
requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
flask
|
||||
gunicorn
|
||||
Reference in New Issue
Block a user