Update Dockerfile
Browse files- Dockerfile +9 -10
Dockerfile
CHANGED
|
@@ -1,21 +1,20 @@
|
|
| 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
|
| 13 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 14 |
-
RUN echo "nameserver 8.8.8.8" >> /etc/resolv.conf
|
| 15 |
-
RUN echo "nameserver 8.8.4.4" >> /etc/resolv.conf
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
| 19 |
|
| 20 |
-
COPY --chown=user . /app
|
| 21 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
FROM python:3.9
|
| 2 |
|
| 3 |
+
# Install curl for testing
|
| 4 |
+
RUN apt-get update && apt-get install -y curl
|
| 5 |
+
|
| 6 |
+
# Set up user
|
| 7 |
RUN useradd -m -u 1000 user
|
| 8 |
USER user
|
|
|
|
| 9 |
|
| 10 |
WORKDIR /app
|
| 11 |
|
| 12 |
+
COPY --chown=user requirements.txt .
|
| 13 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
COPY --chown=user . .
|
| 16 |
+
|
| 17 |
+
# Test connectivity (this will run as the non-root user)
|
| 18 |
+
RUN curl -v https://api.telegram.org || echo "Connectivity test failed, but continuing build"
|
| 19 |
|
|
|
|
| 20 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|