Rajeev-86 commited on
Commit
6f65770
·
1 Parent(s): 9760ba7

combined the commands of installation, downloading models and uninstallation of gdown in Dockerfile for smaller image

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -9
Dockerfile CHANGED
@@ -3,24 +3,23 @@ FROM pytorch/torchserve:0.12.0-cpu
3
 
4
  USER root
5
 
6
- # 2. Install gdown and immediately uninstall it for a smaller image
7
- RUN pip install --no-cache-dir gdown && pip uninstall gdown -y
8
-
9
- # 3. Install other dependencies and clean up
10
  COPY requirements.txt /tmp/requirements.txt
11
  RUN pip install -r /tmp/requirements.txt && rm /tmp/requirements.txt
12
 
13
  WORKDIR /home/model-server
14
  RUN mkdir model_store
15
 
16
- # 4. Download models using gdown
17
- RUN gdown 1x9lGntRiYsNb-dYf1SugGGwnoGa_oQes -O model_store/UNET.mar
18
- RUN gdown 1Y_P77RtNnC1StUeBGlONuNGAW5rFq02S -O model_store/R-UNET.mar
19
- RUN gdown 1VYvAh5S5MQICbqmQkNJ1Epdmcm5VgVWb -O model_store/A-R-UNET.mar
 
 
20
 
21
  USER model-server
22
 
23
- # 5. Start TorchServe with all models
24
  CMD ["torchserve", \
25
  "--start", \
26
  "--ncs", \
 
3
 
4
  USER root
5
 
6
+ # 2. Install other dependencies and clean up
 
 
 
7
  COPY requirements.txt /tmp/requirements.txt
8
  RUN pip install -r /tmp/requirements.txt && rm /tmp/requirements.txt
9
 
10
  WORKDIR /home/model-server
11
  RUN mkdir model_store
12
 
13
+ # 3. Installing gdown, downloading models and immediately uninstalling it for a smaller image
14
+ RUN pip install --no-cache-dir gdown && \
15
+ gdown 1x9lGntRiYsNb-dYf1SugGGwnoGa_oQes -O model_store/UNET.mar && \
16
+ gdown 1Y_P77RtNnC1StUeBGlONuNGAW5rFq02S -O model_store/R-UNET.mar && \
17
+ gdown 1VYvAh5S5MQICbqmQkNJ1Epdmcm5VgVWb -O model_store/A-R-UNET.mar && \
18
+ pip uninstall gdown -y
19
 
20
  USER model-server
21
 
22
+ # 4. Start TorchServe with all models
23
  CMD ["torchserve", \
24
  "--start", \
25
  "--ncs", \