nahArnav commited on
Commit
b17e227
·
verified ·
1 Parent(s): b40a693

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -0
Dockerfile CHANGED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use the official Python 3.10 image
2
+ FROM python:3.10-slim
3
+
4
+ # Hugging Face requires the container to run as user 1000
5
+ RUN useradd -m -u 1000 user
6
+ USER user
7
+
8
+ # Set up environment variables
9
+ ENV HOME=/home/user \
10
+ PATH=/home/user/.local/bin:$PATH
11
+
12
+ # Set the working directory
13
+ WORKDIR $HOME/app
14
+
15
+ # Copy your app files into the container
16
+ COPY --chown=user . $HOME/app
17
+
18
+ # Upgrade pip and install the requirements
19
+ RUN pip install --no-cache-dir --upgrade pip && \
20
+ pip install --no-cache-dir -r requirements.txt
21
+
22
+ # Expose the standard Hugging Face Spaces port
23
+ EXPOSE 7860
24
+
25
+ # Boot up the FastAPI server
26
+ # NOTE: If your server file is named app.py, change "main:app" to "app:app"
27
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]