Add docker workflow

This commit is contained in:
2024-02-16 11:41:54 +01:00
parent 15f4a7a1ef
commit e498dcefd9
3 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,27 @@
name: Build Formula10 Docker Image
on:
push:
branches: [master]
paths:
- ".gitea/workflows/*"
- "Dockerfile"
- "*.py"
- "requirements.txt"
jobs:
build-docker:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Login to container registry
uses: docker/login-action@v3
with:
registry: gitea.vps.chriphost.de
username: ${{ secrets.CONTAINER_REGISTRY_USER }}
password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}
- name: Build Docker image
run: docker build . --file Dockerfile --tag gitea.vps.chriphost.de/christoph/formula10:latest
- name: Push Docker image
run: docker push gitea.vps.chriphost.de/christoph/formula10:latest

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
# syntax=docker/dockerfile:1
FROM python:3.10.1-slim-buster
RUN apt-get update -y
WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
COPY . .
CMD ["python3", "-u", "formula10.py"]

6
requirements.txt Normal file
View File

@ -0,0 +1,6 @@
rich
numpy
flask
flask-sqlalchemy
sqlalchemy