Evolve icon indicating copy to clipboard operation
Evolve copied to clipboard

Create Dockerfile

Open nivertius opened this issue 1 year ago • 1 comments

This PR creates a Dockerfile that will build an image that will run evolve as a static page.

Docker file is platform-agnostic, as all of the base images are dockerhub library images and promised to be available for all supported platforms. It built well on my machine for both amd64 arch and armhf. Versions of the images are not precisely locked, as builder step is only restricted to node version 20. Runner image is more restricted though.

The Dockerfile is somewhat optimized, as it uses separate build step, and the resulting image only contains files needed to render the page and run scripts. The copy directives are also sorted from the least changing to the most changing, so layers should be preserved as much as possible. The resulting image is 24MB total, in which about 15MB is the game, and 9MB is nginx.

This PR also fixes the .gitignore as it excluded .* for some reason, so both .gitignore and .dockerignore are not processed by git. This is most unusual, and if there are some dot-files that should be ignored by git they should definitely be put explicitly by name in the .gitignore. As this is additional change only tangentially related to this PR, if it doesn't meet your need, I will revert it.

Lastly, the page starts without errors and plays well - I did a hell lord run without any issues on my own instance. But I did not analyze the whole code and there might be some resources that I overlooked, so I would appreciate more engaged maintainer to recheck if everything is included.

nivertius avatar Oct 05 '24 11:10 nivertius

See also https://github.com/pmotschmann/Evolve/pull/1169

fredden avatar Oct 06 '24 16:10 fredden

A docker file got created from a different PR

pmotschmann avatar Apr 10 '25 02:04 pmotschmann