Codingxx commited on
Commit
6e65396
·
verified ·
1 Parent(s): 9822262

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -2
Dockerfile CHANGED
@@ -1,2 +1,23 @@
1
- FROM huggingface/autotrain-advanced:latest
2
- CMD pip uninstall -y autotrain-advanced && pip install -U autotrain-advanced && autotrain app --host 0.0.0.0 --port 7860 --workers 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Start with an official Python image as the base image
2
+ FROM python:3.9-slim
3
+
4
+ # Set the working directory inside the container
5
+ WORKDIR /app
6
+
7
+ # Copy the requirements.txt file into the container
8
+ COPY requirements.txt /app/
9
+
10
+ # Install the required Python dependencies
11
+ RUN pip install --no-cache-dir -r requirements.txt
12
+
13
+ # Copy the rest of the application code into the container
14
+ COPY . /app/
15
+
16
+ # Expose the port that FastAPI will run on
17
+ EXPOSE 8000
18
+
19
+ # Set the environment variable to tell FastAPI that we're running in production mode
20
+ ENV ENV=production
21
+
22
+ # Run the FastAPI app with Uvicorn as the server
23
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]