update with Cleanup Docker resources

This commit is contained in:
leehk 2025-04-13 06:47:15 +08:00
parent 28152eba1a
commit faca3d23bb
2 changed files with 11 additions and 3 deletions

View File

@ -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 \

View File

@ -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