Increase caching potential of docker image

This commit is contained in:
Philipp Grathwohl 2021-12-04 12:09:46 +01:00
parent d80486abd0
commit 4727162002
3 changed files with 52 additions and 0 deletions

50
.dockerignore Normal file
View file

@ -0,0 +1,50 @@
# Docker
docker-compose.yml
.docker
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
**/__pycache__
**/*.py[cod]
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml
# Virtual environment
.env/
.venv/
venv/
venv3/
*.cover
*.log
.git
.mypy_cache
.pytest_cache
.hypothesis
.idea
**/*.swp

View file

@ -91,6 +91,7 @@ jobs:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
target: deploy
push: ${{ steps.prep.outputs.publish_image }}
tags: ${{ steps.prep.outputs.tags }}
labels: |

View file

@ -36,6 +36,7 @@ RUN python3 -m pip install --no-cache-dir --upgrade pip setuptools wheel
COPY --chown=craftbeerpi ./requirements.txt /cbpi-src/
RUN pip3 install --no-cache-dir -r /cbpi-src/requirements.txt
FROM base as deploy
# Install craftbeerpi from source
COPY --chown=craftbeerpi . /cbpi-src
RUN pip3 install --no-cache-dir /cbpi-src