xuminglong commited on
Commit
71faf97
·
1 Parent(s): bf48544

updat deps

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -5
Dockerfile CHANGED
@@ -1,13 +1,24 @@
1
  FROM python:3.12
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
- COPY . .
 
 
10
 
 
 
 
 
11
  EXPOSE 7860
12
 
13
- CMD ["shiny", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.12
2
 
3
+ # Create a non-root user
4
+ RUN useradd -m -u 1000 user
5
 
6
+ # Set environment variables
7
+ ENV HOME=/home/user \
8
+ PATH=/home/user/.local/bin:$PATH
9
 
10
+ # Set working directory
11
+ WORKDIR $HOME/app
12
 
13
+ # Copy requirements and install dependencies
14
+ COPY --chown=user requirements.txt $HOME/app/requirements.txt
15
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
16
 
17
+ # Copy the rest of the application
18
+ COPY --chown=user . $HOME/app
19
+
20
+ # Expose the port
21
  EXPOSE 7860
22
 
23
+ # Run the application
24
+ CMD ["python", "app.py"]