DepartureBoard icon indicating copy to clipboard operation
DepartureBoard copied to clipboard

Trying to run in a docker image using the supplied docker-compose.yml file on a Raspberry Pi 4

Open andrewcliffoutlook opened this issue 1 year ago • 10 comments

I have clone your git repo locally to my Raspberry Pi and updated the docker-compose.yml file with a required rail token and then run sudo docker-compose up -d which then builds the docker image by pulling a .net SDK 6 base image and then running the build process followed by pulling a aspnet image and copying the binaries from the build image. This all works fine. However when the process completes and the docker image starts it fails to start with following error in the logs:

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly '/DepartureBoardWeb.dll'. The system cannot find the file specified. File name: '/DepartureBoardWeb.dll'

I have run the command sudo docker export departureboard-departure-board-1 | tar t > my-container-files.txt and on viewing the output txt file I can see that the DepartureBoardWeb.dll file does exist.

Any help on how I can fix this issue and run this locally on my Raspberry Pi on a docker image.

andrewcliffoutlook avatar Feb 10 '24 11:02 andrewcliffoutlook

Hi @andrewcliffoutlook

Thanks for raising this, I think your the first person to try run it in docker on a raspberry pi. If I was to guess, it's because a raspberry pi is ARM64 rather the X64 then it doesn't build it in docker correctly.

The good news it the code fully supports ARM64 it's just I haven't added support for it within docker. I shall try and add an extra config specifically for building it on a raspberry pi

benfl3713 avatar Feb 11 '24 16:02 benfl3713

@benfl3713 thank you. If there is any additional information I can send you that will highlight what config changes are needed please let me know

andrewcliffoutlook avatar Feb 11 '24 17:02 andrewcliffoutlook

I've fixed this for you now. Turned out to be a very odd problem with paths working differently on the RPI. I've tested it on my Pi5 and it is building a running fine now.

You'll need to git pull to get the changes I've made. And then you'll need to rebuild the docker container with sudo docker-compose build

benfl3713 avatar Feb 11 '24 20:02 benfl3713

@benfl3713, thank you. That is working now. Whilst I can now run a local view by providing my local station via a querystring parameter I note that the system doesn't work completely as a local docker container. For example you cannot goto to the admin section as that points at admin.leddepartureboard.com and you cannot login, the google login doesn't work (I expect this is because you need to be running this as a https site rather than http). How would we get this to run completely local?

I also note from logs coming from the docker container that you need more than realtime train token details, it says you need nationalrail login details. Would you consider documenting how you apply for these and what the entries in the config file should look like.

andrewcliffoutlook avatar Feb 12 '24 10:02 andrewcliffoutlook

I think to run it locally I just need to add the url into a whitelist. What port are you running it on, guessing it's 9005? And are you accessing it via http://localhost:9005 or are you referencing it remotely such as http://raspberrypi:9005

benfl3713 avatar Feb 12 '24 17:02 benfl3713

And yes, for things like searching for a station, it requires national rail login. I can provide some information on how to obtain this info

benfl3713 avatar Feb 12 '24 17:02 benfl3713

And yes, for things like searching for a station, it requires national rail login. I can provide some information on how to obtain this info

Hi @benfl3713 please could you send me details on how I do this as when you run this locally the code runs through a process which ideally would have these details and it means the code performs much slower then it does on your leddeparturesboard.com site

andrewcliffoutlook avatar Feb 13 '24 15:02 andrewcliffoutlook

Hi @andrewcliffoutlook I have added the following guide to the repo: https://github.com/benfl3713/DepartureBoard/blob/master/RUNNING_LOCALLY.md

I'm recalling from memory, so if you experience something different or need any help, let me know and I can update the guide with more info

benfl3713 avatar Feb 13 '24 20:02 benfl3713

Note the api your probably interested in setting up is the National Rail Knowledge API

benfl3713 avatar Feb 13 '24 20:02 benfl3713

@benfl3713, thank you for putting up the instructions. You have been super responsive and shown how open source code can really work.

andrewcliffoutlook avatar Feb 13 '24 22:02 andrewcliffoutlook