Skip to content

Commit

Permalink
Merge pull request #91 from jpower432/chore/add-dockerignore
Browse files Browse the repository at this point in the history
chore: add a .dockerignore file
  • Loading branch information
jpower432 authored Dec 5, 2023
2 parents 752a6a1 + bff5215 commit 0a2b604
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN mkdir -p "$PYSETUP_PATH"
# Installing poetry and pipx.
RUN python3 -m pip install --no-cache-dir --upgrade pip \
&& python3 -m pip install --no-cache-dir pipx \
&& python3 -m pipx install poetry==$POETRY_VERSION
&& python3 -m pipx install poetry=="$POETRY_VERSION"

# set permissions
RUN chown trestlebot:trestlebot -R /home/trestlebot
Expand Down
19 changes: 19 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Configuration files
.github/**
.mega-linter.yml
.pre-commit-config.yaml
.flake8
sonar-project.properties

# Docs
docs/
CONTRIBUTING.md
TROUBLESHOOTING.md

# Local files
.git
.cache
.env
**/.venv/**
.coverage
.coverage.*
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Use the UBI 8 minimal base image
# kics-scan disable=fd54f200-402c-4333-a5a4-36ef6709af2f
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest as python-base
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest AS python-base

ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
Expand All @@ -21,7 +21,7 @@ RUN microdnf update -y \
&& microdnf clean all \
&& rm -rf /var/lib/apt/lists/*

FROM python-base as dependencies
FROM python-base AS dependencies

ARG POETRY_VERSION=1.5.1

Expand All @@ -40,15 +40,15 @@ WORKDIR "/build"
COPY . "/build"

# Install runtime deps and install the project in non-editable mode.
RUN python3.9 -m venv $VENV_PATH && \
. $VENV_PATH/bin/activate && \
RUN python3.9 -m venv "$VENV_PATH" && \
. "$VENV_PATH"/bin/activate && \
poetry install --without tests,dev --no-root && \
poetry build -f wheel -n && \
pip install --no-cache-dir --no-deps dist/*.whl && \
rm -rf dist *.egg-info
rm -rf dist ./*.egg-info


FROM python-base as final
FROM python-base AS final

COPY --from=dependencies $PYSETUP_PATH $PYSETUP_PATH

Expand Down

0 comments on commit 0a2b604

Please sign in to comment.