From cdf40048733ee44de83fbf83b1049159209ce254 Mon Sep 17 00:00:00 2001 From: "Shiny Brar (he/il)" Date: Mon, 10 Jun 2024 16:01:03 -0400 Subject: [PATCH] fix(dockerfile): fixes --- .github/workflows/debug.yml | 17 +++++++++++++++++ Dockerfile | 11 ++++------- 2 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/debug.yml diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml new file mode 100644 index 0000000..6747fc5 --- /dev/null +++ b/.github/workflows/debug.yml @@ -0,0 +1,17 @@ +on: + workflow_dispatch: + inputs: + debug_enabled: + type: boolean + description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' + required: false + default: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} diff --git a/Dockerfile b/Dockerfile index bf63727..b097aaa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,7 @@ # Build Command # export DOCKER_BUILDKIT=1; docker buildx build -t chimefrb/workflow:latest . -ARG PYTHON_VERSION=3.10 -ARG PROJECT_NAME=workflow +ARG PYTHON_VERSION=3.8 FROM python:${PYTHON_VERSION}-slim as base @@ -17,8 +16,8 @@ ENV PYTHONUNBUFFERED=1 \ POETRY_HOME="/opt/poetry" \ POETRY_VIRTUALENVS_IN_PROJECT=true \ POETRY_NO_INTERACTION=1 \ - PYSETUP_PATH="/opt/${PROJECT_NAME}" \ - VENV_PATH="/opt/${PROJECT_NAME}/.venv" \ + PYSETUP_PATH="/opt/workflow" \ + VENV_PATH="/opt/workflow/.venv" \ DEBIAN_FRONTEND=noninteractive \ OPENMP_ENABLED=1 @@ -63,10 +62,8 @@ WORKDIR $PYSETUP_PATH RUN set -ex \ && poetry install --without dev --without docs --no-interaction --no-ansi --no-cache -v +# Final Image FROM base as production -# Copy Virtual Environment COPY --from=builder $VENV_PATH $VENV_PATH -# Copy Project Files COPY --from=builder $PYSETUP_PATH $PYSETUP_PATH -WORKDIR $PYSETUP_PATH CMD ["workflow"]