Skip to content

Commit

Permalink
fix(dockerfile): fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shinybrar committed Jun 10, 2024
1 parent fc959da commit cdf4004
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
@@ -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 }}
11 changes: 4 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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"]

0 comments on commit cdf4004

Please sign in to comment.