Spaces:
Runtime error
Runtime error
nsthorat-lilac
commited on
Commit
•
edc50a8
1
Parent(s):
2d8cc9a
Upload Dockerfile with huggingface_hub
Browse files- Dockerfile +34 -0
Dockerfile
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# NOTE: When we upgrade to 3.11 we can use a slimmer docker image which comes with gcc.
|
2 |
+
FROM python:3.9-bullseye
|
3 |
+
|
4 |
+
# Allow statements and log messages to immediately appear in the Knative logs
|
5 |
+
ENV PYTHONUNBUFFERED True
|
6 |
+
|
7 |
+
# See: https://huggingface.co/docs/hub/spaces-sdks-docker#permissions
|
8 |
+
RUN useradd -m -u 1000 user
|
9 |
+
USER user
|
10 |
+
ENV HOME=/home/user \
|
11 |
+
PATH=/home/user/.local/bin:$PATH
|
12 |
+
|
13 |
+
# Set the working directory in the container.
|
14 |
+
WORKDIR $HOME/app
|
15 |
+
|
16 |
+
# Install the dependencies. This will look in ./dist for any wheels that match lilac. If they are
|
17 |
+
# not found, it will use the public pip package.
|
18 |
+
COPY --chown=user /dist ./dist/
|
19 |
+
RUN python -m pip install --find-links=dist lilac[all]
|
20 |
+
|
21 |
+
COPY --chown=user .env .
|
22 |
+
COPY --chown=user .env.demo .
|
23 |
+
# Copy the README so we can read the datasets from the HuggingFace config.
|
24 |
+
COPY --chown=user README.md .
|
25 |
+
# Copy the license just in case.
|
26 |
+
COPY --chown=user LICENSE .
|
27 |
+
|
28 |
+
COPY --chown=user docker_start.sh docker_start.py ./
|
29 |
+
|
30 |
+
# Make a local data directory for non-persistent storage demos.
|
31 |
+
RUN mkdir -p ./data
|
32 |
+
RUN chown -R user ./data
|
33 |
+
|
34 |
+
CMD ["bash", "docker_start.sh"]
|