Add file to create a docker container for the HTTP server#24
Conversation
| If you plan to use your GPU(s) for training, you will need to install NVIDIA drivers and the NVIDIA Container Toolkit. [https://docs.nvidia.com/ai-enterprise/deployment/vmware/latest/docker.html] | ||
|
|
||
| Build the docker container by running docker `docker build --tag 'fir_trainer' .` | ||
| Build the docker container by running docker `docker build -f Dockerfile.trainer --tag 'fir_trainer' .` |
There was a problem hiding this comment.
I didn't actually test these commands, but can. I'm fairly positive the syntax is correct.
| cd fir | ||
| python3 -m http.server | ||
| ``` | ||
| ### Docker |
There was a problem hiding this comment.
I did test the dockerfile build and run process, as well as the port override functionality.
GICodeWarrior
left a comment
There was a problem hiding this comment.
Thanks for the contribution. 🙂
I'm not sure of the advantage of inserting Docker (for this or for training), but I'm nominally OK with adding it.
For the "server" image, maybe consider using the (much smaller) busybox image.
Here's an example:
FROM busybox:1.35
# Create a non-root user to own the files and run our server
RUN adduser -D static
USER static
WORKDIR /home/static
# Copy the static website
# Use the .dockerignore file to control what ends up inside the image!
COPY . .
# Run BusyBox httpd
CMD ["busybox", "httpd", "-f", "-v", "-p", "3000"]Source: https://lipanski.com/posts/smallest-docker-image-static-website
(for security reasons though, please don't use one of the bespoke images)
If you want a more lean set of files to copy, you should only need foxhole, includes, index.html, favicon.ico, and LICENSE.
Regarding the "trainer" image instructions, your changes look OK. I haven't used that image myself.
Cool! 100% aligned with using the busybox image. Smaller footprint the better. I'll clean things up and fire the PR back once cleaned up. For some context, I'm actually standing this up alongside some traefik (I believe nginx will do the same thing) instance so you can hit the same FQDN, but it'll route you to different docker containers based on the path of the URL. I can test the trainer image prior to firing this back over to you. |
Note that the domain name is a security perimeter. So running multiple apps on one domain name (i.e. inside a shared perimeter) has some security implications.
To complete a training run requires a bunch of content exported from the game assets (via FModel) and (optionally) a directory of the desired icon mods. There is a thread on the LOGI discord with more details if you're interested. I'm happy to have more folks familiar with how to run the training, and at the same time, that's not a prerequisite for this PR. |
0691492 to
413b8a8
Compare
Added the build steps and run command to run the HTTP server from a docker container. At the same time updated the existing Dockerfile to not conflict with the added Dockerfile.
413b8a8 to
0c337b0
Compare
|
I went ahead and updated the docker container to use busybox's certified image at version 1.37. |
| # Busybox's httpd doesn't support a mime type for .mjs | ||
| # files by default, so we'll need to add it to httpd.conf | ||
| # manually. The http daemon also treats .js files as | ||
| # application/javascript by default. However, in | ||
| # RFC 9239 application/javascript has been marked as | ||
| # obselete in favor of text/javascript. So we're overriding | ||
| # that mime type as well. | ||
| RUN printf ".mjs:text/javascript\n.js:text/javascript\n" > httpd.conf |
Hey!
Been a lurker for a little bit. But was working on getting this app running on a self hosted Ubuntu server I run on my domain. So created a Dockerfile to run the http server inside of a docker container. It's a little dirty as I just add everything in the whole directory to the container; javascript isn't really my area of expertise.
But thought I'd push it back up to you to see if you'd like it.
I also updated the README with steps on how to use it and run it.
Let me know if you're interested in the changes or if you want any changes made.
Thanks for all of the work you've done so far! Excited to help build out the tool a little more to help out us logi mains.