diff --git a/.gitea/workflows/test_secret.yaml b/.gitea/workflows/test_secret.yaml index fa4a804..a725e64 100644 --- a/.gitea/workflows/test_secret.yaml +++ b/.gitea/workflows/test_secret.yaml @@ -6,17 +6,12 @@ jobs: runs-on: ubuntu-latest # Use a standard python image so you don't have to pre-build anything container: - image: python:3.12-slim + image: gitea-modal-runner:latest steps: - name: Checkout code uses: actions/checkout@v4 - - name: Install Dependencies - run: | - apt-get update && apt-get install -y git - pip install modal - - name: Deploy worker pipeline to Modal run: | cd workspace/sprint_1_2/CODEBASE/deps/implementation diff --git a/workspace/sprint_1_2/CODEBASE/deps/implementation/Dockerfile b/workspace/sprint_1_2/CODEBASE/deps/implementation/Dockerfile new file mode 100644 index 0000000..80ee306 --- /dev/null +++ b/workspace/sprint_1_2/CODEBASE/deps/implementation/Dockerfile @@ -0,0 +1,30 @@ +# --- Stage 1: Builder --- +FROM python:3.12-slim AS builder + +# Install build dependencies +RUN apt-get update && apt-get install -y --no-install-recommends \ + curl \ + git \ + && rm -rf /var/lib/apt/lists/* + +# Install python dependencies into a local folder +RUN pip install --user modal + +# --- Stage 2: Runner --- +FROM python:3.12-slim + +# Install only the runtime dependencies needed for Gitea Actions +RUN apt-get update && apt-get install -y --no-install-recommends \ + git \ + && curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \ + && apt-get install -y nodejs \ + && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Copy the installed packages from the builder stage +COPY --from=builder /root/.local /root/.local + +# Ensure the local bin is in the PATH +ENV PATH=/root/.local/bin:$PATH + +# WORKDIR /workspace +CMD [ "bash" ] \ No newline at end of file