triflix commited on
Commit
f5a62f1
·
verified ·
1 Parent(s): 06fbe5b

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -0
Dockerfile ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a lightweight Python base image
2
+ FROM python:3.9-slim
3
+
4
+ # Set the working directory inside the container
5
+ WORKDIR /code
6
+
7
+ # Copy the requirements file first to leverage Docker layer caching
8
+ COPY ./requirements.txt /code/requirements.txt
9
+
10
+ # Install Python dependencies
11
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
12
+
13
+ # Copy the entire 'app' directory into the container
14
+ COPY ./app /code/app
15
+
16
+ # Expose the port the app will run on (Hugging Face Spaces default)
17
+ EXPOSE 7860
18
+
19
+ # Command to run the application using uvicorn
20
+ # --host 0.0.0.0 makes the server accessible from outside the container
21
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]