added docker shit
Some checks failed
release-tag / release-image (push) Failing after 36s

This commit is contained in:
2026-05-26 09:31:48 +02:00
parent 014ae73f6d
commit 17134a7859
4 changed files with 64 additions and 2 deletions

View File

@@ -0,0 +1,52 @@
name: release-tag
on:
push
jobs:
release-image:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
env:
DOCKER_ORG: angoosh
DOCKER_LATEST: latest
RUNNER_TOOL_CACHE: /toolcache
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker BuildX
uses: docker/setup-buildx-action@v2
with:
config-inline: |
[registry."gitea.angoosh.com"]
#http = true
#insecure = true
- name: Login to DockerHub
uses: docker/login-action@v2
with:
registry: https://gitea.angoosh.com
username: ${{ secrets.PKG_REG_USER }}
password: ${{ secrets.PKG_REG_PASS }}
- name: Get Meta
id: meta
run: |
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
platforms: |
linux/amd64
push: true
tags: |
gitea.angoosh.com/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ env.DOCKER_LATEST }}

9
Dockerfile Normal file
View File

@@ -0,0 +1,9 @@
FROM python:3-alpine
ADD requirements.txt /
RUN pip install -r requirements.txt
ADD app.py /
RUN mkdir /db
VOLUME /db
EXPOSE 5000
CMD [ "python", "./app.py" ]

4
app.py
View File

@@ -9,7 +9,7 @@ from flask import Flask, render_template_string, redirect, url_for
import sqlite3 import sqlite3
app = Flask(__name__) app = Flask(__name__)
DB_FILE = 'counter.db' DB_FILE = '/db/counter.db'
def init_db(): def init_db():
"""Initialize the database and set the starting number to 0 if it doesn't exist.""" """Initialize the database and set the starting number to 0 if it doesn't exist."""
@@ -98,4 +98,4 @@ if __name__ == '__main__':
# Initialize the database before starting the server # Initialize the database before starting the server
init_db() init_db()
# Run the app in debug mode # Run the app in debug mode
app.run(debug=True) app.run(debug=True)

1
requirements.txt Normal file
View File

@@ -0,0 +1 @@
flask