add dockerfile and jenkinsfile

This commit is contained in:
2026-01-24 16:34:27 -05:00
parent c68956c078
commit 010d81169a
2 changed files with 73 additions and 0 deletions

19
Dockerfile Normal file
View File

@@ -0,0 +1,19 @@
# Dockerfile for 'Are We Buried?'
FROM python:3.12-slim
# Set environment
ENV PYTHONUNBUFFERED=1
WORKDIR /app
# Install dependencies
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . /app
# Expose the Flask port
EXPOSE 5000
# Run the Flask app
CMD ["python", "app.py"]

54
Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,54 @@
pipeline {
agent any
environment {
REGISTRY = "gitea.thewrightserver.net"
IMAGE = "gitea.thewrightserver.net/josh/areweburied"
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"
}
}
}