rajeshchoudharyt commited on
Commit
ab68865
·
1 Parent(s): c5e0ec8

update directory structure

Browse files
Files changed (3) hide show
  1. Dockerfile +12 -7
  2. app/__init__.py +0 -0
  3. app.py → app/main.py +0 -0
Dockerfile CHANGED
@@ -1,15 +1,20 @@
1
  FROM python:3.10.13
2
 
3
- WORKDIR /
 
 
 
 
4
 
5
  RUN useradd -m -u 1000 user
6
  USER user
7
 
8
- # Copy the current directory contents into the container at .
9
- COPY --chown=user . .
 
 
 
10
 
11
- # Install requirements.txt
12
- RUN pip install -r /requirements.txt
13
 
14
- # Start the FastAPI app on port 7860, the default port expected by Spaces
15
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.10.13
2
 
3
+ WORKDIR /code
4
+
5
+ COPY ./requirements.txt /code/requirements.txt
6
+
7
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
 
9
  RUN useradd -m -u 1000 user
10
  USER user
11
 
12
+ ENV HOME=/home/user
13
+
14
+ COPY ./app /code/app
15
+
16
+ WORKDIR $HOME/app
17
 
18
+ COPY --chown=user . $HOME/app
 
19
 
20
+ CMD ["fastapi", "run", "app/main.app", "--port", "80"]
 
app/__init__.py ADDED
File without changes
app.py → app/main.py RENAMED
File without changes