Spaces:
Runtime error
Runtime error
Abineshkumar77 commited on
Commit ·
3cb7741
1
Parent(s): 4d9a3fc
Add application file
Browse files- Dockerfile +8 -17
Dockerfile
CHANGED
|
@@ -1,23 +1,14 @@
|
|
| 1 |
-
# Use an official Python runtime as a parent image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
| 6 |
|
| 7 |
-
|
| 8 |
-
COPY . /app
|
| 9 |
|
| 10 |
-
|
| 11 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
-
|
| 14 |
-
EXPOSE 80
|
| 15 |
|
| 16 |
-
|
| 17 |
-
ENV HF_HOME=/app/.hf_cache
|
| 18 |
-
|
| 19 |
-
# Create cache directory
|
| 20 |
-
RUN mkdir -p /app/.hf_cache
|
| 21 |
-
|
| 22 |
-
# Run app.py when the container launches
|
| 23 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "80"]
|
|
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
RUN useradd user
|
| 4 |
+
USER user
|
| 5 |
+
ENV HOME=/home/user \
|
| 6 |
+
PATH=/home/user/.local/bin:$PATH
|
| 7 |
|
| 8 |
+
WORKDIR $HOME/app
|
|
|
|
| 9 |
|
| 10 |
+
COPY --chown=user ./ $HOME/app
|
|
|
|
| 11 |
|
| 12 |
+
RUN pip install -r requirements.txt
|
|
|
|
| 13 |
|
| 14 |
+
CMD fastapi run --reload --host=0.0.0.0 --port=7860
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|