diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index d16bf37..2d460d5 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -2,8 +2,9 @@ name: Docker Image CI on: push: - branches: [ "main" ] - pull_request: + paths-ignore: + - build/base.Dockerfile + - .github/workflows/base-docker-image.yml branches: [ "main" ] jobs: @@ -34,7 +35,10 @@ jobs: path: 'model/blazeface' - name: Pull latest from DO - run: docker pull registry.digitalocean.com/thesmile/thesmile:latest + run: docker pull registry.digitalocean.com/thesmile/thesmile-base:latest + + - name: Tag for local use + run: docker image tag registry.digitalocean.com/thesmile/thesmile-base:latest thesmile:latest - name: Build the Docker image run: docker build . --file build/Dockerfile --tag thesmile:$(date +%Y%m%d-%s) --tag thesmile:latest diff --git a/build/Dockerfile b/build/Dockerfile index 6ce4fb9..1f4b399 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,15 +1,9 @@ # start by pulling the python image -FROM python:3.12 - -# copy the requirements file into the image -COPY ./requirements.txt /app/requirements.txt +FROM thesmile-base:latest # switch working directory WORKDIR /app -# install the dependencies and packages in the requirements file -RUN pip install -r requirements.txt - # copy every content from the local file to the image COPY . /app