Bhushan26 commited on
Commit
1a6e687
1 Parent(s): 8a06f11

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -13
Dockerfile CHANGED
@@ -1,20 +1,23 @@
1
- # Use an official Python runtime as a parent image
2
- FROM python:3.9-slim
3
 
4
- # Set the working directory in the container
 
 
 
5
  WORKDIR /app
6
 
7
- # Copy the current directory contents into the container at /app
8
- COPY . /app
9
 
10
- # Install any needed packages specified in requirements.txt
11
- RUN pip install --no-cache-dir -r requirements.txt
12
 
13
- # Make port 7860 available to the world outside this container
14
- EXPOSE 7860
15
 
16
- # Define environment variable
17
- ENV NAME World
 
18
 
19
- # Run app.py when the container launches
20
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Dockerfile
 
2
 
3
+ # Use a base image appropriate for your application
4
+ FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9
5
+
6
+ # Set working directory
7
  WORKDIR /app
8
 
9
+ # Copy requirements.txt first for caching dependencies
10
+ COPY ./requirements.txt .
11
 
12
+ # Install dependencies
13
+ RUN pip install -r requirements.txt
14
 
15
+ # Copy the rest of the application code
16
+ COPY . .
17
 
18
+ # Create necessary directories and set permissions
19
+ RUN mkdir -p /app/static/uploads /app/static/results \
20
+ && chmod -R 777 /app/static
21
 
22
+ # Start the application
23
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]