BramVanroy commited on
Commit
0918e19
·
1 Parent(s): 0ce49c4

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +41 -0
Dockerfile ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:latest
2
+ ENV DEBIAN_FRONTEND=noninteractive
3
+ RUN apt-get -y update \
4
+ && apt-get -y install build-essential curl git software-properties-common
5
+
6
+ RUN add-apt-repository ppa:deadsnakes/ppa \
7
+ && apt-get -y update \
8
+ && apt-get -y install python3.9 python3.9-dev python3-pip python3.9-distutils
9
+
10
+ RUN ln -s /usr/bin/python3.9 /usr/bin/python \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ LABEL authors="Bram Vanroy"
14
+
15
+ RUN git clone https://github.com/BramVanroy/mateo-demo.git
16
+ WORKDIR /mateo-demo
17
+
18
+ RUN python -m pip install --no-cache-dir --upgrade pip && python -m pip install --no-cache-dir --upgrade .
19
+
20
+ ENV PORT=5004
21
+ ENV SERVER="localhost"
22
+ ENV BASE=""
23
+ ENV NO_CUDA=""
24
+ ENV DEMO_MODE=""
25
+ EXPOSE $PORT
26
+ HEALTHCHECK CMD curl --fail http://$SERVER:$PORT$BASE/_stcore/health
27
+
28
+ WORKDIR /mateo-demo/src/mateo_st
29
+
30
+ CMD if [ -z "$BASE" ]; then \
31
+ cmd="streamlit run 01_🎈_MATEO.py --server.port $PORT --browser.serverAddress $SERVER"; \
32
+ else \
33
+ cmd="streamlit run 01_🎈_MATEO.py --server.port $PORT --browser.serverAddress $SERVER --server.baseUrlPath $BASE"; \
34
+ fi; \
35
+ if [ "$NO_CUDA" = "true" ] || [ "$DEMO_MODE" = "true" ]; then \
36
+ opts="--"; \
37
+ [ "$NO_CUDA" = "true" ] && opts="$opts --no_cuda"; \
38
+ [ "$DEMO_MODE" = "true" ] && opts="$opts --demo_mode"; \
39
+ cmd="$cmd $opts"; \
40
+ fi; \
41
+ exec $cmd