File size: 918 Bytes
f7a65ec
 
 
 
 
 
7379bd2
743cb9b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1dc6869
7379bd2
f0211c6
7379bd2
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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"]