Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +11 -3
Dockerfile
CHANGED
@@ -1,14 +1,22 @@
|
|
1 |
FROM python:3.10-slim
|
2 |
|
|
|
3 |
RUN useradd user
|
4 |
USER user
|
5 |
ENV HOME=/home/user \
|
6 |
-
|
|
|
7 |
|
8 |
WORKDIR $HOME/app
|
9 |
|
|
|
10 |
COPY --chown=user ./ $HOME/app
|
11 |
|
12 |
-
|
|
|
13 |
|
14 |
-
|
|
|
|
|
|
|
|
|
|
1 |
FROM python:3.10-slim
|
2 |
|
3 |
+
# Create a user and set the working directory
|
4 |
RUN useradd user
|
5 |
USER user
|
6 |
ENV HOME=/home/user \
|
7 |
+
PATH=/home/user/.local/bin:$PATH \
|
8 |
+
HF_TOKEN="hf_BSEQRrgyRVuNfkhWwUjTwGEQxUvYRySrzda"
|
9 |
|
10 |
WORKDIR $HOME/app
|
11 |
|
12 |
+
# Copy the application code
|
13 |
COPY --chown=user ./ $HOME/app
|
14 |
|
15 |
+
# Install dependencies from requirements.txt
|
16 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
|
18 |
+
# Expose port 7860 (FastAPI default)
|
19 |
+
EXPOSE 7860
|
20 |
+
|
21 |
+
# Set the entrypoint for the FastAPI app
|
22 |
+
CMD ["uvicorn", "app:app", "--reload", "--host=0.0.0.0", "--port=7860"]
|