Spaces:
Running
Running
Commit
·
7d5387e
1
Parent(s):
b767539
Trying to make container image smaller through Dockerfile
Browse files- Dockerfile +11 -9
Dockerfile
CHANGED
@@ -1,15 +1,17 @@
|
|
1 |
# First stage: build dependencies
|
2 |
-
FROM public.ecr.aws/docker/library/python:3.11.9-slim-bookworm
|
|
|
3 |
|
4 |
# Install Lambda web adapter in case you want to run with with an AWS Lamba function URL (not essential if not using Lambda)
|
5 |
#COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.8.3 /lambda-adapter /opt/extensions/lambda-adapter
|
6 |
|
7 |
# Install wget, curl, and build-essential
|
8 |
RUN apt-get update && apt-get install -y \
|
9 |
-
wget \
|
10 |
-
curl \
|
11 |
&& rm -rf /var/lib/apt/lists/*
|
12 |
|
|
|
|
|
|
|
13 |
# Create a directory for the model
|
14 |
RUN mkdir /model && mkdir /model/rep && mkdir /model/embed
|
15 |
|
@@ -29,12 +31,12 @@ RUN useradd -m -u 1000 user
|
|
29 |
RUN chown -R user:user /home/user
|
30 |
|
31 |
# Make output folder
|
32 |
-
RUN mkdir -p /home/user/app/output && chown -R user:user /home/user/app/output
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
|
39 |
# Download the quantised phi model directly with curl. Changed at it is so big - not loaded
|
40 |
#RUN curl -L -o /home/user/app/model/rep/Phi-3.1-mini-128k-instruct-Q4_K_M.gguf https://huggingface.co/bartowski/Phi-3.1-mini-128k-instruct-GGUF/tree/main/Phi-3.1-mini-128k-instruct-Q4_K_M.gguf
|
|
|
1 |
# First stage: build dependencies
|
2 |
+
#FROM public.ecr.aws/docker/library/python:3.11.9-slim-bookworm
|
3 |
+
FROM python:3.11.9-slim-bookworm
|
4 |
|
5 |
# Install Lambda web adapter in case you want to run with with an AWS Lamba function URL (not essential if not using Lambda)
|
6 |
#COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.8.3 /lambda-adapter /opt/extensions/lambda-adapter
|
7 |
|
8 |
# Install wget, curl, and build-essential
|
9 |
RUN apt-get update && apt-get install -y \
|
|
|
|
|
10 |
&& rm -rf /var/lib/apt/lists/*
|
11 |
|
12 |
+
#wget \
|
13 |
+
#curl \
|
14 |
+
|
15 |
# Create a directory for the model
|
16 |
RUN mkdir /model && mkdir /model/rep && mkdir /model/embed
|
17 |
|
|
|
31 |
RUN chown -R user:user /home/user
|
32 |
|
33 |
# Make output folder
|
34 |
+
RUN mkdir -p /home/user/app/output && chown -R user:user /home/user/app/output \
|
35 |
+
&& mkdir -p /home/user/.cache/huggingface/hub && chown -R user:user /home/user/.cache/huggingface/hub \
|
36 |
+
&& mkdir -p /home/user/.cache/matplotlib && chown -R user:user /home/user/.cache/matplotlib \
|
37 |
+
&& mkdir -p /home/user/app/model/rep && chown -R user:user /home/user/app/model/rep \
|
38 |
+
&& mkdir -p /home/user/app/model/embed && chown -R user:user /home/user/app/model/embed \
|
39 |
+
&& mkdir -p /home/user/app/cache && chown -R user:user /home/user/app/cache
|
40 |
|
41 |
# Download the quantised phi model directly with curl. Changed at it is so big - not loaded
|
42 |
#RUN curl -L -o /home/user/app/model/rep/Phi-3.1-mini-128k-instruct-Q4_K_M.gguf https://huggingface.co/bartowski/Phi-3.1-mini-128k-instruct-GGUF/tree/main/Phi-3.1-mini-128k-instruct-Q4_K_M.gguf
|