ShreyMehra commited on
Commit
ea7519a
1 Parent(s): 1e6ad5b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +54 -17
Dockerfile CHANGED
@@ -1,23 +1,60 @@
1
- # Use the official lightweight Python image.
2
- # https://hub.docker.com/_/python
3
- FROM python:3.7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
- # Allow statements and log messages to immediately appear in the Knative logs
6
- ENV PYTHONUNBUFFERED True
7
 
8
- EXPOSE 8080
 
 
 
 
 
9
 
10
- # Copy local code to the container image.
11
- ENV APP_HOME /app
12
- WORKDIR $APP_HOME
13
- COPY . ./
14
 
15
- # Install production dependencies.
16
  RUN pip install -r requirements.txt
17
 
18
- # Run the web service on container startup. Here we use the gunicorn
19
- # webserver, with one worker process and 8 threads.
20
- # For environments with multiple CPU cores, increase the number of workers
21
- # to be equal to the cores available.
22
- # Timeout is set to 0 to disable the timeouts of the workers to allow Cloud Run to handle instance scaling.
23
- CMD streamlit run --server.port 8080 --server.enableCORS false app.py
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # # Use the official lightweight Python image.
2
+ # # https://hub.docker.com/_/python
3
+ # FROM python:3.7
4
+
5
+ # # Allow statements and log messages to immediately appear in the Knative logs
6
+ # ENV PYTHONUNBUFFERED True
7
+
8
+ # EXPOSE 8080
9
+
10
+ # # Copy local code to the container image.
11
+ # ENV APP_HOME /app
12
+ # WORKDIR $APP_HOME
13
+ # COPY . ./
14
+
15
+ # # Install production dependencies.
16
+ # RUN pip install -r requirements.txt
17
+
18
+ # # Run the web service on container startup. Here we use the gunicorn
19
+ # # webserver, with one worker process and 8 threads.
20
+ # # For environments with multiple CPU cores, increase the number of workers
21
+ # # to be equal to the cores available.
22
+ # # Timeout is set to 0 to disable the timeouts of the workers to allow Cloud Run to handle instance scaling.
23
+ # CMD streamlit run --server.port 8080 --server.enableCORS false app.py
24
 
 
 
25
 
26
+ FROM python:3.7
27
+
28
+ RUN pip install virtualenv
29
+ ENV VIRTUAL_ENV=/venv
30
+ RUN virtualenv venv -p python3
31
+ ENV PATH="VIRTUAL_ENV/bin:$PATH"
32
 
33
+ WORKDIR /app
34
+ ADD . /app
 
 
35
 
36
+ # Install dependencies
37
  RUN pip install -r requirements.txt
38
 
39
+ # copying all files over
40
+ COPY . /app
41
+
42
+ # Expose port
43
+ ENV PORT 8501
44
+
45
+ # cmd to launch app when container is run
46
+ CMD streamlit run app.py
47
+
48
+ # streamlit-specific commands for config
49
+ ENV LC_ALL=C.UTF-8
50
+ ENV LANG=C.UTF-8
51
+ RUN mkdir -p /root/.streamlit
52
+ RUN bash -c 'echo -e "\
53
+ [general]\n\
54
+ email = \"\"\n\
55
+ " > /root/.streamlit/credentials.toml'
56
+
57
+ RUN bash -c 'echo -e "\
58
+ [server]\n\
59
+ enableCORS = false\n\
60
+ " > /root/.streamlit/config.toml'