stts-se / chromedictator

Demo app for testing Google Chrome's ASR API
MIT License
0 stars 0 forks source link

Docker and packaging (was: Setup morf demo) #41

Open HannaLindgren opened 5 years ago

jensedlund commented 5 years ago

I'm trying to find time today to write a Docker file that builds and runs this. Should be really straightforward, but I don't really think I'll find the time. I'll let you know if I do though.

NikolajLindberg commented 5 years ago

There is a prebuilt "golang" Docker image, so creating a Dockerfile should be fairly straightforward, something along the lines of:

  FROM golang
  RUN git clone https://github.com/stts-se/chromedictator
  RUN cd chromedictator
  RUN go get
  RUN go build
  CMD ./chromedictator

or what ever (I assume that git is already installed in the golang image).

A thing to notice is that currently, the audio file dir and the abbrevs file (and the port number) are hard wired, and automatically created if they do not exist. This makes it easy to forget to mount an external audio dir on the host machine when starting the Docker container: all generated files will be lost when exiting the container...

Maybe the audio_files dir should have to be "manually" created and given as a command line parameter when starting the server.

HannaLindgren commented 5 years ago

@jensedlund Why do you need Docker? Isn't it easy enough to download a zip file, unzip and run?

jensedlund commented 5 years ago

Yup. But in the long run, it'll be serving calls from a cloud server on which everything is Dockerized, for a slew of reasons. Setting it up isn't a problem at all tho.

/j

jensedlund commented 5 years ago

There is a prebuilt "golang" Docker image, so creating a Dockerfile should be fairly straightforward, something along the lines of:

  FROM golang
  RUN git clone https://github.com/stts-se/chromedictator
  RUN cd chromedictator
  RUN go get
  RUN go build
  CMD ./chromedictator

or what ever (I assume that git is already installed in the golang image).

A thing to notice is that currently, the audio file dir and the abbrevs file (and the port number) are hard wired, and automatically created if they do not exist. This makes it easy to forget to mount an external audio dir on the host machine when starting the Docker container: all generated files will be lost when exiting the container...

Maybe the audio_files dir should have to be "manually" created and given as a command line parameter when starting the server.

No don't worry, the mounting isn't a problem now. For (much) later versions I guess we'll fix some config or options, but now simple is best.