Skip to content

Commit

Permalink
build(docker): on CI Docker Job, build for Stage prod_install (--targ…
Browse files Browse the repository at this point in the history
…et), since missing vgg weights
  • Loading branch information
boromir674 committed Nov 3, 2023
1 parent 25041ea commit 6123ae0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,13 @@ jobs:
run: |
# workflow enabled for branches and v* tags
IMAGE_TAG="${GITHUB_REF_NAME}" # this is branch name or tag name
echo "IMAGE_REF=neural-style-transfer:${IMAGE_TAG}" >> $GITHUB_ENV
docker build -t "${DOCKER_USER}/neural-style-transfer:${IMAGE_TAG}" .
echo "IMAGE_REF=neural-style-transfer-cli:${IMAGE_TAG}" >> $GITHUB_ENV
# build an image that does not have vgg model weights
# TODO: add image model weights file in this env somehow
docker build --target prod_install -t "${DOCKER_USER}/neural-style-transfer:${IMAGE_TAG}" .
- name: Publish Docker Image to DockerHub
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
Expand Down
11 changes: 9 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,19 @@ RUN pip install --no-cache-dir --user ./dist/*.whl

# Optionaly, add the CLI executable to the PATH
# to make the `nst` CLI available in the image
# ENV PATH="/root/.local/bin:$PATH"
ENV PATH="/root/.local/bin:$PATH"

## This is a Builder kind of Stage
## Consider using the docker feature on-build

### END of Prod BUILD ###
# build: docker build --target prod_install -t nst_cli .
# Usable as: docker run -it --rm nst_cli --entrypoint nst

# EG: docker run -it --rm nst_cli nst --help

CMD [ "nst" ]

### END of Prod Build Installation ###



Expand Down

0 comments on commit 6123ae0

Please sign in to comment.