-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
72 lines (53 loc) · 1.74 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# syntax = docker/dockerfile:1.2
FROM python:3.9 as base
SHELL ["/bin/bash", "-c"]
RUN apt-get update && apt-get install -y --no-install-recommends \
less \
vim \
gcc \
build-essential \
zlib1g-dev \
wget \
unzip \
cmake \
gfortran \
libblas-dev \
liblapack-dev \
libatlas-base-dev \
# libasound-dev \
# libportaudio2 \
# libportaudiocpp0 \
# portaudio19-dev \
# ffmpeg \
libsm6 \
libxext6 \
default-jre \
&& apt-get clean
# Get Rust; NOTE: using sh for better compatibility with other base images
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
RUN curl -fsSL https://ollama.com/install.sh | sh
# Add .cargo/bin to PATH
ENV PATH="/root/.cargo/bin:${PATH}"
FROM base as build
SHELL ["/bin/bash", "-c"]
WORKDIR /leolani-text-to-ekg
COPY . ./
RUN make clean
RUN ollama serve & sleep 5 && make build
RUN make build
#RUN make clean & make build & make build
# To build a specfic stage only use the --target option, e.g.:
# docker build --target build --tag build:0.0.1 .
FROM base as leolani
COPY --from=build /leolani-text-to-ekg/app /leolani-text-to-ekg/app/
COPY --from=build /root/nltk_data /root/nltk_data
WORKDIR /leolani-text-to-ekg/app
RUN rm spacy.lock; make spacy.lock project_dependencies=""
# Copy the models from the base stage
COPY --from=build /root/.ollama/models /root/.ollama/models
# RUN rm ollama.lock; ollama serve & sleep 5 && make ollama.lock project_dependencies=""
WORKDIR /leolani-text-to-ekg/app/py-app
RUN printf '#!/bin/bash\nollama serve &\nsource /leolani-text-to-ekg/app/venv/bin/activate\npython app.py "$@"\n' > run.sh
RUN chmod +x run.sh
ARG NAME
CMD ./run.sh --name $NAME