Serving from docker

Hello
I am interested to serve by using docker. I mostly used the Dockerfile in the repository after adding restserver-xavante and cloning OpenNMT from github. Finally I need to add a CMD like
CMD ["th","tools/rest_translation_server.lua","-model","model/"${MODEL},"-gpuid","1","-host","0.0.0.0","-port","8080","-case_feature","-bpe_model","model/"${BPE_MODEL}]

I am using docker-compose.yml pass the value of ${MODEL} and ${BPE_MODEL} as a ARG in Dockerfile.

But I am getting following error during when I am running it
/bin/sh: 1: [th,tools/rest_translation_server.lua,-model,model/model.t7,-gpuid,1,-host,0.0.0.0,-port,8080,-case_feature,-bpe_model,model/bpe_model.bpe]: not found

If I remove the CMD command from the Dockerfile. After building the docker image i can run it interactively by using nvidia-docker run and it’s working fine. I can run the th tools/rest_translation_server.lua ... command from inside of the container.

Hello,

You should probably use ENTRYPOINT instead of CMD.

1 Like

Thanks @guillaumekln
I did figure it out.

use following
CMD th tools/rest_translation_server.lua -model ${MODEL} -gpuid 1 -host 0.0.0.0 -port 8080 -case_feature -bpe_model ${BPE_MODEL}

Anyway you guys are awesome

Thanks