Arafath10 commited on
Commit
0a9e3f3
1 Parent(s): 0aa47e0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -11
Dockerfile CHANGED
@@ -1,21 +1,21 @@
1
- FROM python:3.9
2
 
3
 
4
- # Set up a new user named "user" with user ID 1000
5
- RUN useradd -m -u 1000 user
6
 
7
- # Switch to the "user" user
8
- USER user
9
 
10
 
11
- COPY --chown=user ./requirements.txt /api/requirements.txt
12
- COPY --chown=user ./fastapi-demo /api/fastapi-demo
 
 
 
 
 
13
 
14
- WORKDIR /api
15
 
16
- RUN pip install --upgrade pip
17
- RUN pip install -r requirements.txt
18
 
 
 
19
 
20
  # Get secret EXAMPLE and output it to /test at buildtime
21
  # RUN --mount=type=secret,id=EXAMPLE,mode=0444,required=true \
@@ -25,4 +25,4 @@ RUN pip install -r requirements.txt
25
  # RUN --mount=type=secret,id=SECRET_EXAMPLE,mode=0444,required=true \
26
  # git clone $(cat /run/secrets/SECRET_EXAMPLE)
27
 
28
- CMD ["uvicorn", "fastapi-demo.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
 
2
 
 
 
3
 
 
 
4
 
5
 
6
+ FROM python:3.9
7
+
8
+ WORKDIR /code
9
+
10
+ COPY ./requirements.txt /code/requirements.txt
11
+
12
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
13
 
14
+ COPY ./main.py /code/app/main.py
15
 
 
 
16
 
17
+ RUN mkdir -p /data
18
+ RUN chmod 777 /data
19
 
20
  # Get secret EXAMPLE and output it to /test at buildtime
21
  # RUN --mount=type=secret,id=EXAMPLE,mode=0444,required=true \
 
25
  # RUN --mount=type=secret,id=SECRET_EXAMPLE,mode=0444,required=true \
26
  # git clone $(cat /run/secrets/SECRET_EXAMPLE)
27
 
28
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]