Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker development environment #96

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

J-Nova
Copy link

@J-Nova J-Nova commented Jan 22, 2024

I noticed that there was no docker dev environment for this game!
So i created one, it uses docker compose and i have updated the readme on how to use it.

Some benefits of dockerization with this:

Together with volume mapping it has hot reloading. So if you make a change, you can refresh the page and see your changes.

Healthcheck, you have a dev/app/backend and client/game server. The client/game server only will start once the backend is running properly.

No hassle of setting up the whole enviroment and editing your host file etc. Just one command and you have it running.

Automatic cloning of the devapp backend and patching it to support dockerization.

Aswell as instead of having hardcoded data in the config.py it uses the data from your secrets file (Renamed that to secrets_data as there is a default python package named secrets).

@thmsndk
Copy link
Contributor

thmsndk commented Jan 22, 2024

I'll review it more later, but I'm curious about the hot reloading, when the server is started, it performs different funtions that generate data.

If I add a new item in design/items.py will the server restart so this item becomes present? in general, what happens when I edit things inside the design folder? I would think that would require both the appserver and the gameserver to restart?

Sure hotloading might work for the frontend client (game.js) if I change anything there.

But what if I change something in node/server.js that would require stopping the game server and starting it again.

@J-Nova
Copy link
Author

J-Nova commented Jan 22, 2024

I'll review it more later, but I'm curious about the hot reloading, when the server is started, it performs different funtions that generate data.

If I add a new item in design/items.py will the server restart so this item becomes present? in general, what happens when I edit things inside the design folder? I would think that would require both the appserver and the gameserver to restart?

Sure hotloading might work for the frontend client (game.js) if I change anything there.

But what if I change something in node/server.js that would require stopping the game server and starting it again.

Hi there, sorry for not fully explaining the hot reloading. Docker cant really manage your state, so if you are changing actual started container files it would need a restart yes or if calculates things with the changed data. I could have explained better that with hot reloading i ment changing frontend/client things in /js folder for example. Then you would only need to refresh your browser to view the changes.
For example changing a buff its data in the design folder. There you can also just refresh the browser and see that the buff has changed (For example holidayspirit, change it to 2000 and refresh your browser and it is 2000. Tested this aswell) or changing an item its stats etc. But to get the actual changes being effective and used for calculations the server would have to be restarted to have it take effect. But the data that is changed is shown on website on reload. I hope that that kind of explains it better what i meant with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants