MemeLabs / Rustla2

Livestream viewing with chat
https://strims.gg
MIT License
44 stars 24 forks source link

Make container test function properly #277

Closed x-Xymos closed 4 years ago

x-Xymos commented 4 years ago

Before I was doing some scuffed test that didn't test the binary properly, it now creates an .env file for the server to actually start and then does another test by calling the /api endpoint. I had to include an apt install curl in the Dockerfile to test the endpoint as you can't install any new packages in the image at runtime because the image run as an unprivileged user.

The gotcha with this was that when you mount ~/Rustla2 when running the docker image, if the ~/Rustla2/public folder doesn't exist it crashes, I guess the code never checks if the directory exists, I discovered this by deleting files and folders one by one from the mounted folder until it broke.

@slugalisk I'm not sure what happened today with the image you ran but I tested it locally and it worked fine, I think you might have missed something. The only difference that is obvious to me is that the rustla2_api binary is no longer copied into /usr/local/bin/ and as a result the entrypoint is ["/bin/bash", "-c", "/api/rustla2_api ${extraArgs} && sleep infinity"] Maybe if you give me more deets as to how you start it, I might be able to spot the issue.

slugalisk commented 4 years ago

@x-Xymos sweet, thanks for figuring this out 👍