Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experiment A #1

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 19 additions & 23 deletions Dockerfile.prefect
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
# This image (built via Dockerfile.prefect) is used for the Prefect backend.
FROM prefecthq/prefect:1.3.1-python3.10 as python-base
FROM python:3.10-slim as base

RUN apt-get update && apt-get install -y curl
# tell prefect where to find our package code
ENV PYTHONPATH=/workdir/

# RUN curl -sL https://install.python-poetry.org | python - -y
RUN pip install poetry

FROM python-base as builder-base
# needed to build psutil on arm64
RUN apt-get update && apt-get install -y gcc python3-dev git gcc g++ libblas-dev
# RUN apt-get update && apt-get install -y --no-install-recommends gcc python3-dev git gcc

COPY pyproject.toml poetry.lock /aid/

ENV APP_HOME /aid/
WORKDIR $APP_HOME
# python dependencies
RUN pip install --upgrade pip
RUN pip install poetry

RUN poetry config virtualenvs.create true
RUN poetry config virtualenvs.in-project true
RUN poetry install --only main --no-root
FROM base
RUN poetry config virtualenvs.create false
RUN poetry config virtualenvs.prefer-active-python true
RUN poetry config installer.no-binary :all:

FROM builder-base as final-stage
COPY README.md aid/ /aid/
RUN poetry install --only main
# RUN ls -la /
# RUN mkdir /workdir/
# RUN ls -la /workdir/
WORKDIR /workdir/

RUN ls -la /
RUN ls -la /aid/
COPY . /workdir/

# Setup env, assuming repos are mounted correctly at runtime
ENV PYTHONPATH="$PYTHONPATH:/aid/.venv/"
# put prefect into the path - should not be needed??
# ENV PATH="$PATH:/aid"
RUN poetry install --only main --no-root