OussamaElfila21 commited on
Commit
7b7ac20
·
verified ·
1 Parent(s): a8b2e7e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -6
Dockerfile CHANGED
@@ -1,11 +1,8 @@
1
  # Use a specific Python version
2
  FROM python:3.11.10-slim
3
 
4
- RUN useradd -m -u 1000 user
5
- USER user
6
- ENV PATH="/home/user/.local/bin:$PATH"
7
-
8
- WORKDIR /app
9
 
10
  # Install system dependencies
11
  RUN apt-get update && apt-get install -y \
@@ -23,9 +20,20 @@ RUN pip install --upgrade pip
23
  COPY requirements.txt .
24
  RUN pip install -r requirements.txt
25
 
 
 
26
 
27
  # Build Cython extensions
28
  RUN cd utils && python setup.py build_ext --inplace
29
 
30
- # Specify the command to run the application with Gunicorn
 
 
 
 
 
 
 
 
 
31
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  # Use a specific Python version
2
  FROM python:3.11.10-slim
3
 
4
+ # Set the working directory inside the container
5
+ WORKDIR /usr/src/app
 
 
 
6
 
7
  # Install system dependencies
8
  RUN apt-get update && apt-get install -y \
 
20
  COPY requirements.txt .
21
  RUN pip install -r requirements.txt
22
 
23
+ # Copy your application code into the container
24
+ COPY . .
25
 
26
  # Build Cython extensions
27
  RUN cd utils && python setup.py build_ext --inplace
28
 
29
+ # Create necessary directories if they don't exist and fix permissions
30
+ RUN mkdir -p data/models && \
31
+ mkdir -p .cache && \
32
+ chmod -R 777 .cache && \
33
+ chmod -R 777 data
34
+
35
+ # Expose the port for FastAPI application
36
+ EXPOSE 7860
37
+
38
+ # Specify the command to run the application with uvicorn directly
39
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]