dsmueller commited on
Commit
f1ffcb6
1 Parent(s): c7bf968

Refactor Dockerfile to improve directory structure

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -7
Dockerfile CHANGED
@@ -13,11 +13,11 @@ ENV HOME=/data \
13
  PATH=/home/user/.local/bin:$PATH
14
 
15
  # Change permissions for to read/write/execute
16
- RUN mkdir $HOME/app
17
- RUN chmod 777 $HOME/app
18
 
19
  # Set the working directory to the user's home directory
20
- WORKDIR $HOME/app
21
 
22
  # Install poetry
23
  RUN pip3 install poetry
@@ -30,16 +30,16 @@ COPY --chown=user pyproject.toml poetry.lock ./
30
  RUN poetry config virtualenvs.in-project true
31
 
32
  # Set the name of the virtual environment
33
- RUN poetry config virtualenvs.path $HOME/app/.venv
34
 
35
  # Install dependencies
36
  RUN poetry install
37
 
38
  # Set the .venv folder as the virtual environment directory
39
- ENV PATH="$HOME/app/.venv/bin:$PATH"
40
 
41
  # Copy the current directory contents into the container
42
- COPY --chown=user . $HOME/app
43
 
44
  # Make a port available to the world outside this container
45
  # The EXPOSE instruction informs Docker that the container listens on the specified network ports at runtime. Your container needs to listen to Streamlit’s (default) port 8501.
@@ -49,7 +49,7 @@ EXPOSE 8501
49
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
50
 
51
  # Update working directory to be consistent with where Start.py is
52
- WORKDIR $HOME/app/scripts
53
 
54
  # An ENTRYPOINT allows you to configure a container that will run as an executable. Here, it also contains the entire streamlit run command for your app, so you don’t have to call it from the command line
55
  ENTRYPOINT ["streamlit", "run", "Start.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
13
  PATH=/home/user/.local/bin:$PATH
14
 
15
  # Change permissions for to read/write/execute
16
+ # RUN mkdir $HOME/app
17
+ # RUN chmod 777 $HOME/app
18
 
19
  # Set the working directory to the user's home directory
20
+ WORKDIR $HOME
21
 
22
  # Install poetry
23
  RUN pip3 install poetry
 
30
  RUN poetry config virtualenvs.in-project true
31
 
32
  # Set the name of the virtual environment
33
+ RUN poetry config virtualenvs.path $HOME/.venv
34
 
35
  # Install dependencies
36
  RUN poetry install
37
 
38
  # Set the .venv folder as the virtual environment directory
39
+ ENV PATH="$HOME/.venv/bin:$PATH"
40
 
41
  # Copy the current directory contents into the container
42
+ COPY --chown=user . $HOME
43
 
44
  # Make a port available to the world outside this container
45
  # The EXPOSE instruction informs Docker that the container listens on the specified network ports at runtime. Your container needs to listen to Streamlit’s (default) port 8501.
 
49
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
50
 
51
  # Update working directory to be consistent with where Start.py is
52
+ WORKDIR $HOME/scripts
53
 
54
  # An ENTRYPOINT allows you to configure a container that will run as an executable. Here, it also contains the entire streamlit run command for your app, so you don’t have to call it from the command line
55
  ENTRYPOINT ["streamlit", "run", "Start.py", "--server.port=8501", "--server.address=0.0.0.0"]