-
Notifications
You must be signed in to change notification settings - Fork 29
/
Dockerfile
39 lines (26 loc) · 1.16 KB
/
Dockerfile
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
30
31
32
33
34
35
36
37
38
39
ARG LOCAL_VERSION
FROM ghcr.io/defenseunicorns/leapfrogai/leapfrogai-sdk:${LOCAL_VERSION} AS sdk
# hardened and slim python w/ developer tools image
FROM ghcr.io/defenseunicorns/leapfrogai/python:3.11-dev AS builder
ARG SDK_DEST=src/leapfrogai_sdk/build
USER root
WORKDIR /leapfrogai
COPY --from=sdk /leapfrogai/${SDK_DEST} ${SDK_DEST}
COPY packages/repeater packages/repeater
# create virtual environment for light-weight portability and minimal libraries
RUN python -m venv .venv
ENV PATH="/leapfrogai/.venv/bin:$PATH"
RUN rm -f packages/repeater/build/*.whl && \
python -m pip wheel packages/repeater -w packages/repeater/build --find-links=${SDK_DEST} && \
pip install packages/repeater/build/lfai_repeater*.whl --no-index --find-links=packages/repeater/build/
# hardened and slim python image
FROM ghcr.io/defenseunicorns/leapfrogai/python:3.11
ENV PATH="/leapfrogai/.venv/bin:$PATH"
WORKDIR /leapfrogai
COPY --from=builder /leapfrogai/.venv/ /leapfrogai/.venv/
COPY packages/repeater/main.py .
COPY packages/repeater/config.yaml .
# Publish port
EXPOSE 50051
# Run the repeater model
ENTRYPOINT ["python", "-m", "leapfrogai_sdk.cli", "--app-dir=.", "main:Model"]