Spaces:
Sleeping
Sleeping
Commit
·
a399757
1
Parent(s):
5ea71bc
Update Dockerfile
Browse files- Dockerfile +46 -6
Dockerfile
CHANGED
@@ -1,6 +1,46 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# syntax=docker/dockerfile:1
|
2 |
+
|
3 |
+
ARG DEBIAN_VERSION=bullseye
|
4 |
+
|
5 |
+
################################################################################
|
6 |
+
# Use debian image as downloader image for final stage.
|
7 |
+
# https://hub.docker.com/_/debian
|
8 |
+
################################################################################
|
9 |
+
FROM debian:${DEBIAN_VERSION}-slim AS downloader
|
10 |
+
|
11 |
+
# Set working directory.
|
12 |
+
WORKDIR /download
|
13 |
+
|
14 |
+
# Install curl.
|
15 |
+
RUN apt-get update && apt-get install -y curl
|
16 |
+
|
17 |
+
# Download latest llamafile-server from github.
|
18 |
+
RUN curl -L -o ./llamafile-server https://github.com/Mozilla-Ocho/llamafile/releases/download/0.4.1/llamafile-server-0.4.1
|
19 |
+
|
20 |
+
# Make llamafile-server executable.
|
21 |
+
RUN chmod +x ./llamafile-server
|
22 |
+
|
23 |
+
################################################################################
|
24 |
+
# Use scratch image as final image.
|
25 |
+
# https://hub.docker.com/_/scratch
|
26 |
+
################################################################################
|
27 |
+
FROM debian:${DEBIAN_VERSION}-slim AS final
|
28 |
+
|
29 |
+
# Create user to run llamafile-server as non-root.
|
30 |
+
RUN addgroup --gid 1000 user
|
31 |
+
RUN adduser --uid 1000 --gid 1000 --disabled-password --gecos "" user
|
32 |
+
|
33 |
+
# Switch to user.
|
34 |
+
USER user
|
35 |
+
|
36 |
+
# Set working directory.
|
37 |
+
WORKDIR /usr/src/app
|
38 |
+
|
39 |
+
# Copy llamafile-server from downloader image.
|
40 |
+
COPY --from=downloader /download/llamafile-server ./llamafile-server
|
41 |
+
|
42 |
+
# Expose 8080 port.
|
43 |
+
EXPOSE 8080
|
44 |
+
|
45 |
+
# Set entrypoint.
|
46 |
+
ENTRYPOINT ["/bin/sh", "/usr/src/app/llamafile-server", "--host", "0.0.0.0"]
|