digitransit-ui icon indicating copy to clipboard operation
digitransit-ui copied to clipboard

Deploying digitransit-ui on public production server

Open dancesWithCycles opened this issue 4 years ago • 1 comments

Hi folks, Thank you very much for creating and maintaining this repository. I would like to deploy this UI on a public production server but did not find documentation yet.

I heard about folks using Docker for deployment. I have not used Docker yet but could work my way into it. Any suggestions how this works in detail?

I deployed another Javascript based project using webpack and pm2. I configured webpack to build a static website. Finally I added a process to pm2 that invokes this static website and handles maintenance. I do not see this configuration present in this UI and do not know if it is even recommended to follow this thought for this UI. What is your opinion?

Is there any other strategy you are aware of or you can recommend for deployment?

I am very happy about any advice pointing me in the right direction.

Cheers!

dancesWithCycles avatar Jun 03 '21 18:06 dancesWithCycles

Locally you can run the code as a docker container by building the project with for example docker build -t digitransit-ui . and then run it docker run -it -p 8080:8080 -e CONFIG=<insert the config you use> digitransit-ui. You can then publish the version with docker push to some docker registry like docker hub where you first need to a have an account. We publish our images to https://hub.docker.com/r/hsldevcom/digitransit-ui as part of our github actions CI process. Then you can run the docker image in some dev/prod environment either directly with docker or by using some docker orchestrator (there are many options).

I don't have experience trying to run digitransit-ui with pm2 or with modyfying our webpack build for that purpose. If you find a way to do it, you can describe the process here and/or create a pull request that updates the documentation in this repository (the README files).

optionsome avatar Jun 10 '21 09:06 optionsome