diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index bd90874..991a12d 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -16,6 +16,9 @@ jobs: contents: read packages: write steps: + - name: Cleanup Docker resources + if: always() + run: docker system prune -a -f --volumes - name: Checkout uses: actions/checkout@v3 with: @@ -37,6 +40,9 @@ jobs: - name: Push image run: | docker push ${{ env.IMAGE }}:latest + - name: Cleanup Docker resources + if: always() + run: docker system prune -a -f --volumes test: name: Test Docker Image @@ -61,7 +67,9 @@ jobs: --tag ${{ env.IMAGE }}:latest \ --file ./app/backend/Dockerfile.prod \ "./app/backend" - + - name: Cleanup Docker resources + if: always() + run: docker system prune -a -f --volumes - name: Run container run: | docker run \ diff --git a/app/backend/Dockerfile.prod b/app/backend/Dockerfile.prod index 12f7151..8f70f74 100644 --- a/app/backend/Dockerfile.prod +++ b/app/backend/Dockerfile.prod @@ -3,7 +3,7 @@ ########### # pull official base image -FROM python:3.11-slim-bookworm as builder +FROM python:3.11-slim as builder # set working directory @@ -36,7 +36,7 @@ RUN pipenv run pip install black==23.12.1 flake8==7.0.0 isort==5.13.2 ######### # pull official base image -FROM python:3.11-slim-bookworm +FROM python:3.11-slim # create directory for the app user RUN mkdir -p /home/app