Spaces:
Running
Running
fix: changes in the docker
Browse files- Dockerfile +8 -1
Dockerfile
CHANGED
@@ -3,7 +3,13 @@
|
|
3 |
|
4 |
FROM python:3.10
|
5 |
|
|
|
6 |
RUN useradd -m -u 1000 user
|
|
|
|
|
|
|
|
|
|
|
7 |
USER user
|
8 |
ENV PATH="/home/user/.local/bin:$PATH"
|
9 |
|
@@ -12,7 +18,8 @@ WORKDIR /app
|
|
12 |
COPY --chown=user ./requirements.txt requirements.txt
|
13 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
14 |
RUN python -m spacy download en_core_web_sm || echo "Failed to download model"
|
15 |
-
RUN apt-get update && apt-get install -y libgl1
|
16 |
|
17 |
COPY --chown=user . /app
|
|
|
18 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
3 |
|
4 |
FROM python:3.10
|
5 |
|
6 |
+
# Create user first
|
7 |
RUN useradd -m -u 1000 user
|
8 |
+
|
9 |
+
# Install system dependencies (requires root)
|
10 |
+
RUN apt-get update && apt-get install -y libgl1
|
11 |
+
|
12 |
+
# Switch to non-root user
|
13 |
USER user
|
14 |
ENV PATH="/home/user/.local/bin:$PATH"
|
15 |
|
|
|
18 |
COPY --chown=user ./requirements.txt requirements.txt
|
19 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
20 |
RUN python -m spacy download en_core_web_sm || echo "Failed to download model"
|
|
|
21 |
|
22 |
COPY --chown=user . /app
|
23 |
+
|
24 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
25 |
+
|