DevGirl-Team / tamagokill

Tamagochi, mais version Mirror universe ; Le but n'est pas de le tenir en vie, mais de le tuer. Projet open-source avec la communauté sur Twitch. Pour fêter les 4k followers.
MIT License
29 stars 7 forks source link

chore: create docker image and compose for dev using the watch feature #3

Closed pbrissaud closed 4 months ago

pbrissaud commented 4 months ago

This commit create new image and compose file for dev mode. It use new compose feature watch released in version 2.22.0 (september 2023) to automatically reload container when changes are detected

Video demo (password: tamagokill) https://vimeo.com/952926923?share=copy

There is just a small delay for the API after the change; the time it takes to rebuild.

Don't forget --watch flag in docker compose command to enable this.

Example : docker compose -f compose.dev.yaml up --build --watch

Resources :

pbrissaud commented 4 months ago

Added 2 new env for compose API_PORT and WEB_PORT to define the local port of these services

lilymonad commented 4 months ago

Ach too bad I dumped docker for podman, I can't test the feature (no --watch for podman-compose) ... well I guess a nix devShell wouldn't be a bad thing then lol silly me :p

pbrissaud commented 4 months ago

Both solutions can very well coexist to include as many people as possible!

vasilvestre commented 4 months ago

Why would you use a Dockerfile.dev ? Multistage is made to avoid having multiple files and would be great to use here

pbrissaud commented 4 months ago

Using a multistage build is a viable approach, but having a separate Dockerfile.dev significantly enhances the readability and maintainability of our Docker setup. The distinct files allow developers to differentiate between development and production environments, making it easier to understand and modify the build process for each use case.

pbrissaud commented 4 months ago

Some fixes :