Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +8 -15
Dockerfile
CHANGED
|
@@ -1,21 +1,14 @@
|
|
| 1 |
-
FROM
|
| 2 |
|
| 3 |
-
|
| 4 |
-
USER root
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
RUN apt-get update && apt-get install -y
|
|
|
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
|
| 11 |
|
| 12 |
-
# 4. Copy the shield script into the app directory
|
| 13 |
-
COPY shield.py /app/shield.py
|
| 14 |
-
|
| 15 |
-
# 5. Set Hugging Face port environment variables
|
| 16 |
-
ENV PORT=7860
|
| 17 |
EXPOSE 7860
|
| 18 |
|
| 19 |
-
|
| 20 |
-
# then start Shield on port 7860 in the foreground.
|
| 21 |
-
CMD /new-api --port 3000 & python3 /app/shield.py
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
WORKDIR /app
|
|
|
|
| 4 |
|
| 5 |
+
# Install dependencies
|
| 6 |
+
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
|
| 7 |
+
RUN pip install flask requests mysql-connector-python
|
| 8 |
|
| 9 |
+
# Copy ALL files (shield.py AND index.html)
|
| 10 |
+
COPY . .
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
EXPOSE 7860
|
| 13 |
|
| 14 |
+
CMD ["python3", "shield.py"]
|
|
|
|
|
|