Initial commit
Some checks failed
ci / docker (push) Failing after 1m17s

This commit is contained in:
2024-10-03 11:29:39 +02:00
commit 7dbb1418e9
7 changed files with 70 additions and 0 deletions

8
.dockerignore Normal file
View File

@ -0,0 +1,8 @@
.DS_Store
.coverage
/.env
/.idea/
/.git
/tmp/
/.venv/
__pycache__/

View File

@ -0,0 +1,34 @@
name: ci
on:
push:
env:
IMAGE_NAME: arnaud/my-test-app
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: git.s-algo.com
username: ${{ gitea.repository_owner }}
password: ${{ secrets.GITEA_TOKEN}}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
- name: Build and push
uses: docker/build-push-action@v6
with:
tags: ${{ steps.meta.outputs.tags }}
annotations: ${{ steps.meta.outputs.annotations }}
push: true

8
.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
.DS_Store
.coverage
/.env
/.idea/
/.git
/tmp/
/.venv/
__pycache__/

11
Dockerfile Normal file
View File

@ -0,0 +1,11 @@
FROM python:3.12
WORKDIR /app
COPY ./requirements.txt .
RUN pip install --no-cache-dir --quiet -r requirements.txt
COPY ./my_api ./my_api
CMD ["fastapi", "run", "my_api/app.py"]

0
my_api/__init__.py Normal file
View File

8
my_api/app.py Normal file
View File

@ -0,0 +1,8 @@
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello World"}

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
fastapi[standard]