Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +12 -37
Dockerfile
CHANGED
@@ -1,44 +1,19 @@
|
|
1 |
-
#
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
ENV PYTHONUNBUFFERED=1
|
7 |
-
|
8 |
-
# Install required dependencies
|
9 |
-
RUN apt-get update && apt-get install --no-install-recommends -y \
|
10 |
-
build-essential \
|
11 |
-
python3.9 \
|
12 |
-
python3-pip \
|
13 |
-
git \
|
14 |
-
wget \
|
15 |
-
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
16 |
-
|
17 |
-
# Set up the working directory
|
18 |
-
WORKDIR /code
|
19 |
-
|
20 |
-
# Copy requirements and install dependencies
|
21 |
-
COPY ./requirements.txt /code/requirements.txt
|
22 |
-
RUN pip3 install --no-cache-dir --upgrade -r /code/requirements.txt
|
23 |
-
|
24 |
-
# Set up a new non-root user
|
25 |
RUN useradd -m -u 1000 user
|
26 |
USER user
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
PYTHONPATH=$HOME/app \
|
32 |
-
PYTHONUNBUFFERED=1 \
|
33 |
-
SYSTEM=spaces
|
34 |
|
35 |
-
|
36 |
-
WORKDIR $HOME/app
|
37 |
|
38 |
-
|
39 |
-
COPY --chown=user . $HOME/app
|
40 |
|
41 |
-
RUN
|
42 |
|
43 |
-
|
44 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]
|
|
|
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 |
|
9 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
10 |
+
|
11 |
+
COPY . .
|
|
|
|
|
|
|
12 |
|
13 |
+
WORKDIR /
|
|
|
14 |
|
15 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
|
|
16 |
|
17 |
+
RUN python -m spacy download en_core_web_sm
|
18 |
|
19 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|