diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..469a95b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +*.webp +README.md +.git \ No newline at end of file diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..59790b7 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,32 @@ +name: Build and Push Docker Image + +on: + push: + branches: + - main + - github-action + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Extract Docker image metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ vars.DOCKER_USERNAME }}/facedetection + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + tags: latest + annotations: ${{ steps.meta.outputs.annotations }} + provenance: true + sbom: true \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6137e47 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM python:3.12-slim +WORKDIR /app +# TODO: Double copy for caching purpose +COPY . . +RUN pip install -r requirements.txt +EXPOSE 5001 +# TODO: USER change +CMD ["python", "main.py"] \ No newline at end of file