Abineshkumar77 commited on
Commit
3cb7741
·
1 Parent(s): 4d9a3fc

Add application file

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -17
Dockerfile CHANGED
@@ -1,23 +1,14 @@
1
- # Use an official Python runtime as a parent image
2
  FROM python:3.10-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 80 available to the world outside this container
14
- EXPOSE 80
15
 
16
- # Define environment variable
17
- ENV HF_HOME=/app/.hf_cache
18
-
19
- # Create cache directory
20
- RUN mkdir -p /app/.hf_cache
21
-
22
- # Run app.py when the container launches
23
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "80"]
 
 
1
  FROM python:3.10-slim
2
 
3
+ RUN useradd user
4
+ USER user
5
+ ENV HOME=/home/user \
6
+ PATH=/home/user/.local/bin:$PATH
7
 
8
+ WORKDIR $HOME/app
 
9
 
10
+ COPY --chown=user ./ $HOME/app
 
11
 
12
+ RUN pip install -r requirements.txt
 
13
 
14
+ CMD fastapi run --reload --host=0.0.0.0 --port=7860