MilesCranmer commited on
Commit
4b720d9
1 Parent(s): b31a378

Again try to fix

Browse files
Files changed (1) hide show
  1. gui/Dockerfile +15 -5
gui/Dockerfile CHANGED
@@ -19,14 +19,24 @@ WORKDIR /code
19
 
20
  COPY ./requirements.txt /code/requirements.txt
21
 
22
- # Install Python dependencies:
23
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
 
 
 
 
 
 
 
 
24
 
25
  # Install Julia dependencies
26
- RUN python -c "import pysr"
27
 
28
- COPY . .
 
29
 
30
  EXPOSE 7860
31
 
32
- CMD ["python", "-X", "juliacall-home=/usr/local/julia/bin", "app.py"]
 
19
 
20
  COPY ./requirements.txt /code/requirements.txt
21
 
22
+ # Set up a new user named "user" with user ID 1000
23
+ RUN useradd -m -u 1000 user
24
+ # Switch to the "user" user
25
+ USER user
26
+ # Set home to the user's home directory
27
+ ENV HOME=/home/user
28
+ ENV PATH=/home/user/.local/bin:$PATH
29
+
30
+ # Install Python dependencies in a virtual environment
31
+ RUN python -m venv /home/user/.venv
32
+ RUN source /home/user/.venv/bin/activate && pip install --no-cache-dir --upgrade -r /code/requirements.txt
33
 
34
  # Install Julia dependencies
35
+ RUN source /home/user/.venv/bin/activate && python -c "import pysr"
36
 
37
+ WORKDIR $HOME/app
38
+ COPY --chown=user . $HOME/app
39
 
40
  EXPOSE 7860
41
 
42
+ CMD ["/bin/bash", "-c", "source /home/user/.venv/bin/activate && python /home/user/app/app.py"]