huathedev commited on
Commit
759487d
·
1 Parent(s): e8ed312

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -8
Dockerfile CHANGED
@@ -6,12 +6,12 @@ RUN apt-get update
6
  RUN apt-get install -y --no-install-recommends build-essential gcc
7
  RUN apt-get install -y git
8
 
9
- WORKDIR /usr/service
10
 
11
  # create a virtual environment for python
12
  RUN python -m venv /usr/service/venv
13
- #ENV PATH="/usr/service/venv/bin:$PATH"
14
- ENV PATH=“${PATH}:/root/.local/bin”
15
 
16
  # install python packages into virtual environment
17
  COPY requirements.txt .
@@ -29,12 +29,11 @@ RUN apt-get update
29
  RUN useradd -o -r -u 0 python
30
 
31
  # make the service directory and give "python" user access rights to the directory
32
- RUN mkdir /usr/service && chown python:python /usr/service
33
- WORKDIR /usr/service
34
 
35
  # copy python environment and source files to service directory, and give "python" user
36
  # access rights to these files.
37
- COPY --chown=python:python --from=builder /usr/service/venv venv
38
  COPY --chown=python:python apps/demo apps/demo
39
 
40
  # use the high-privileged "python" user
@@ -43,6 +42,6 @@ USER 0
43
  # use python environment and start service
44
  EXPOSE 8501
45
  #ENV PATH="/usr/service/venv/bin:$PATH"
46
- ENV PATH=“${PATH}:/root/.local/bin”
47
- ENV PYTHONPATH=.
48
  ENTRYPOINT ["streamlit", "run", "apps/demo/ⓘ_Introduction.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
6
  RUN apt-get install -y --no-install-recommends build-essential gcc
7
  RUN apt-get install -y git
8
 
9
+ WORKDIR /app
10
 
11
  # create a virtual environment for python
12
  RUN python -m venv /usr/service/venv
13
+ ENV PATH="/usr/service/venv/bin:$PATH"
14
+ #ENV PATH=“${PATH}:/root/.local/bin”
15
 
16
  # install python packages into virtual environment
17
  COPY requirements.txt .
 
29
  RUN useradd -o -r -u 0 python
30
 
31
  # make the service directory and give "python" user access rights to the directory
32
+ RUN mkdir /app && chown python:python /app
33
+ WORKDIR /app
34
 
35
  # copy python environment and source files to service directory, and give "python" user
36
  # access rights to these files.
 
37
  COPY --chown=python:python apps/demo apps/demo
38
 
39
  # use the high-privileged "python" user
 
42
  # use python environment and start service
43
  EXPOSE 8501
44
  #ENV PATH="/usr/service/venv/bin:$PATH"
45
+ #ENV PATH=“${PATH}:/root/.local/bin”
46
+ #ENV PYTHONPATH=.
47
  ENTRYPOINT ["streamlit", "run", "apps/demo/ⓘ_Introduction.py", "--server.port=8501", "--server.address=0.0.0.0"]