Salahin commited on
Commit
41da6d1
·
verified ·
1 Parent(s): 3420b58

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -14
Dockerfile CHANGED
@@ -1,26 +1,18 @@
1
  # Use an official Python image as a base
2
- FROM python:3.9-slim
3
 
4
  # Set the working directory to /app
5
- WORKDIR /app
6
 
7
  # Copy the requirements file
8
- COPY requirements.txt .
9
 
10
  # Install the dependencies
11
- RUN pip install -r requirements.txt
12
-
13
- # Create a new user and set up the environment
14
- RUN useradd -m -u 1000 user
15
- USER user
16
- ENV HOME=/home/user \
17
- PATH=/home/user/.local/bin:$PATH
18
 
19
  # Copy the application code
20
  COPY . .
21
 
22
- # Expose the port
23
- EXPOSE 8000
24
-
25
  # Run the command to start the development server
26
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
 
1
  # Use an official Python image as a base
2
+ FROM python:3.9
3
 
4
  # Set the working directory to /app
5
+ WORKDIR /code
6
 
7
  # Copy the requirements file
8
+ COPY ./requirements.txt /code/requirements.txt
9
 
10
  # Install the dependencies
11
+ RUN pip install --no-cache-dir --upgrade -r /code/
12
+ requirements.txt
 
 
 
 
 
13
 
14
  # Copy the application code
15
  COPY . .
16
 
 
 
 
17
  # Run the command to start the development server
18
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]