From d305b42743a38a60c2adfc56c895a0d1722ce868 Mon Sep 17 00:00:00 2001 From: Slava Nabatchikov Date: Mon, 12 Dec 2022 15:19:17 +0300 Subject: [PATCH 1/2] create Dockerfile --- Dockerfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d02bc75 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM python:3.10.9-slim-bullseye as base +LABEL maintainer="nvo87@fands.dev" + +ENV PYTHONUNBUFFERED 1 + +WORKDIR /code + +COPY ./requirements.txt /code/requirements.txt + +RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt + +COPY ./src /code/src + +CMD ["uvicorn", "src.main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "80"] From f2f2ec2e52fd58a79aeb332d4a63ac7ca40e4fb0 Mon Sep 17 00:00:00 2001 From: Slava Nabatchikov Date: Mon, 12 Dec 2022 22:19:10 +0300 Subject: [PATCH 2/2] created gh actions simple file --- .github/workflows/ci.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..78d922b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: ci + +on: push + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Read image identifiers + id: image + uses: ASzc/change-string-case-action@v1 + with: + string: ${{ github.repository }} + + - name: Build and push + uses: docker/build-push-action@v3 + with: + push: true + tags: | + ghcr.io/${{ steps.image.outputs.lowercase }}:latest + ghcr.io/${{ steps.image.outputs.lowercase }}:${{ github.sha }} +