Spaces:
Sleeping
Sleeping
Update Dockerfile
#1
by
Redmind
- opened
- Dockerfile +10 -33
Dockerfile
CHANGED
@@ -1,40 +1,17 @@
|
|
1 |
-
|
2 |
-
|
3 |
|
4 |
-
|
5 |
-
# ENV https_proxy="http://72.10.164.178:1417"
|
6 |
-
# ENV no_proxy="localhost,127.0.0.1"
|
7 |
|
8 |
-
|
9 |
-
WORKDIR /code
|
10 |
-
|
11 |
-
## Copy the current directory contents in the container at /code
|
12 |
-
COPY ./requirements.txt /code/requirements.txt
|
13 |
-
|
14 |
-
## Install the requirements.txt
|
15 |
-
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
16 |
-
RUN pip install --no-cache-dir --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
|
17 |
-
|
18 |
-
|
19 |
-
# Set up a new user named "user"
|
20 |
-
RUN useradd user
|
21 |
-
# Switch to the "user" user
|
22 |
USER user
|
|
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
ENV HOME=/home/user \
|
27 |
-
PATH=/home/user/.local/bin:$PATH
|
28 |
-
|
29 |
-
# Set the working directory to the user's home directory
|
30 |
-
WORKDIR $HOME/app
|
31 |
-
|
32 |
-
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
33 |
-
COPY --chown=user . $HOME/app
|
34 |
|
|
|
|
|
35 |
|
36 |
-
|
37 |
-
RUN ls -la $HOME/app
|
38 |
|
39 |
-
|
40 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
+
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
2 |
+
# you will also find guides on how best to write your Dockerfile
|
3 |
|
4 |
+
FROM python:3.9
|
|
|
|
|
5 |
|
6 |
+
RUN useradd -m -u 1000 user
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
USER user
|
8 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
9 |
|
10 |
+
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
13 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
14 |
|
15 |
+
COPY --chown=user . /app
|
|
|
16 |
|
17 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|