FROM ghcr.io/withlogicco/poetry:1.4.2 WORKDIR /code COPY pyproject.toml . COPY poetry.lock . RUN poetry install -vv --no-root --without dev ENV TRANSFORMERS_CACHE /code/data/transformers # configs COPY .dvc/config ./.dvc/config COPY dvc.lock . COPY dvc.yaml . COPY data/transformers.dvc ./data/ # weights RUN --mount=type=secret,id=AWS_ACCESS_KEY_ID,mode=0444,required=true \ --mount=type=secret,id=AWS_SECRET_ACCESS_KEY,mode=0444,required=true \ git init && \ export AWS_ACCESS_KEY_ID=$(cat /run/secrets/AWS_ACCESS_KEY_ID) && \ export AWS_SECRET_ACCESS_KEY=$(cat /run/secrets/AWS_SECRET_ACCESS_KEY) && \ poetry run dvc pull # app data COPY .streamlit/ ./.streamlit/ COPY README.md . COPY shad_mlops_transformers/ ./shad_mlops_transformers/ # second time since --no-root was used RUN poetry install --only-root ENV HF_HOME /code ENTRYPOINT ["streamlit", "run", "shad_mlops_transformers/main.py"]