kidcoconut commited on
Commit
40fcdcc
1 Parent(s): 7c4a981

updated docker to run streamlit and fastapi locally

Browse files
Dockerfile CHANGED
@@ -42,7 +42,7 @@ COPY --chown=user . $HOME/app
42
 
43
  #--- for streamlit; external 49400; internal 39400
44
  # localExec: (from root folder) streamlit run app.py --server.port=39400 --server.maxUploadSize=2000
45
- #EXPOSE 49400
46
  #CMD ["streamlit", "run", "app.py", "--server.port=39400", "--server.maxUploadSize=2000"]
47
 
48
  #--- for fastapi; external 49500; internal 39500
@@ -57,6 +57,7 @@ CMD $HOME/app/scripts/docker/util_docker_preRun.sh
57
 
58
  #--- to build/rebuild the image; make sure you stop and remove the container if you are replacing/upgrading; or change the version tag# from 0.1
59
  # docker build -t img_stm_omdenasaudi_hcc:0.1 .
 
60
 
61
  #--- to tag the image prior to push to DockerHub; docker login and then register user/image:tag
62
  #--- to push this image to DockerHub, example based on the repo: kidcoconut73/img_stm_omdenasaudi_hcc
@@ -75,3 +76,4 @@ CMD $HOME/app/scripts/docker/util_docker_preRun.sh
75
 
76
  #--- Docker build log
77
  # from python:3.10.9-slim-bullseye size: 4.21gb time: >yyys
 
 
42
 
43
  #--- for streamlit; external 49400; internal 39400
44
  # localExec: (from root folder) streamlit run app.py --server.port=39400 --server.maxUploadSize=2000
45
+ EXPOSE 49400
46
  #CMD ["streamlit", "run", "app.py", "--server.port=39400", "--server.maxUploadSize=2000"]
47
 
48
  #--- for fastapi; external 49500; internal 39500
 
57
 
58
  #--- to build/rebuild the image; make sure you stop and remove the container if you are replacing/upgrading; or change the version tag# from 0.1
59
  # docker build -t img_stm_omdenasaudi_hcc:0.1 .
60
+ # docker build -t img_stm_omdenasaudi_hcc:0.1.3 .
61
 
62
  #--- to tag the image prior to push to DockerHub; docker login and then register user/image:tag
63
  #--- to push this image to DockerHub, example based on the repo: kidcoconut73/img_stm_omdenasaudi_hcc
 
76
 
77
  #--- Docker build log
78
  # from python:3.10.9-slim-bullseye size: 4.21gb time: >yyys
79
+ # from python:3.10.9-slim-bullseye size: 4.21gb time: >3500s :0.13 expose streamlit 49400
README.md CHANGED
@@ -6,7 +6,7 @@ colorTo: green
6
  sdk: docker
7
  pinned: false
8
  license: mit
9
- app_port: 49500
10
  ---
11
 
12
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
6
  sdk: docker
7
  pinned: false
8
  license: mit
9
+ app_port: 49400
10
  ---
11
 
12
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
scripts/docker/util_local_buildDockerDemo.sh CHANGED
@@ -14,7 +14,7 @@ blockComment
14
  echo "TRACE: Initializing ..."
15
  kstr_defDkrHubId="kidcoconut73"
16
  kstr_defDkrImageName="img_stm_omdenasaudi_hcc"
17
- kstr_defDkrTagVersion="0.1.2"
18
  kstr_defDkrTagStage="demo"
19
 
20
  strpth_pwd=$(pwd)
@@ -81,5 +81,6 @@ docker tag ${kstr_dkrImg} $kstr_dkrHubImg
81
  docker tag ${kstr_dkrImg} "${kstr_defDkrHubId}/${kstr_defDkrImageName}:${kstr_defDkrTagVersion}"
82
 
83
 
 
84
  #--- push the image to dockerHub
85
  docker push kidcoconut73/img_stm_omdenasaudi_hcc:demo
 
14
  echo "TRACE: Initializing ..."
15
  kstr_defDkrHubId="kidcoconut73"
16
  kstr_defDkrImageName="img_stm_omdenasaudi_hcc"
17
+ kstr_defDkrTagVersion="0.1.3"
18
  kstr_defDkrTagStage="demo"
19
 
20
  strpth_pwd=$(pwd)
 
81
  docker tag ${kstr_dkrImg} "${kstr_defDkrHubId}/${kstr_defDkrImageName}:${kstr_defDkrTagVersion}"
82
 
83
 
84
+ #--- prereq: make sure you are signed in through Docker Desktop
85
  #--- push the image to dockerHub
86
  docker push kidcoconut73/img_stm_omdenasaudi_hcc:demo
scripts/docker/util_local_runDockerDemo.sh CHANGED
@@ -14,7 +14,7 @@ blockComment
14
  kstr_defDkrHubId="kidcoconut73"
15
  kstr_defDkrImageName="img_stm_omdenasaudi_hcc"
16
  kstr_defDkrCtrName=${kstr_defDkrImageName/img_/ctr_}
17
- kstr_defDkrTagVersion="0.1.2"
18
  kstr_defDkrTagStage="demo"
19
 
20
  kstr_dkrImg="${kstr_defDkrImageName}:${kstr_defDkrTagVersion}"
 
14
  kstr_defDkrHubId="kidcoconut73"
15
  kstr_defDkrImageName="img_stm_omdenasaudi_hcc"
16
  kstr_defDkrCtrName=${kstr_defDkrImageName/img_/ctr_}
17
+ kstr_defDkrTagVersion="0.1.3"
18
  kstr_defDkrTagStage="demo"
19
 
20
  kstr_dkrImg="${kstr_defDkrImageName}:${kstr_defDkrTagVersion}"
scripts/streamlitFastApi/util_local_runStreamlitFastApi.sh CHANGED
@@ -12,13 +12,13 @@ mkdir -p data/wsi/raw
12
 
13
  #--- for streamlit; external 49400; internal 39400
14
  echo "INFO: starting streamlit ..."
15
- streamlit run app.py --server.port=49400 --server.maxUploadSize=2000 &
16
 
17
  #--- for fastapi; external 49500; internal 39500
18
  echo "INFO: starting fastapi ..."
19
 
20
  #--- uvicorn main:app --reload --workers 1 --host 0.0.0.0 --port 39500 &
21
- uvicorn main:app --reload --workers 1 --host 0.0.0.0 --port 49500
22
 
23
  #--- wait for any process to exit
24
  #wait -n
 
12
 
13
  #--- for streamlit; external 49400; internal 39400
14
  echo "INFO: starting streamlit ..."
15
+ streamlit run app.py --server.port=39400 --server.maxUploadSize=2000 &
16
 
17
  #--- for fastapi; external 49500; internal 39500
18
  echo "INFO: starting fastapi ..."
19
 
20
  #--- uvicorn main:app --reload --workers 1 --host 0.0.0.0 --port 39500 &
21
+ uvicorn main:app --reload --workers 1 --host 0.0.0.0 --port 39500
22
 
23
  #--- wait for any process to exit
24
  #wait -n