In awscdk-minecraft/awscdk-minecraft-server-deployer/resources/user-data.sh we define the contents of a docker-compose file, but awscdk-minecraft/awscdk-minecraft-server-deployer/src/minecraft_server_deployer/server_stack.py could (and should) instead load up a docker-compose.yml file with these contents and template it there.
We're currently "templating" with what looks like bash variables but is actually used by server_stack.py to fill in those values in the shell script.
and the DOCKER_COMPOSE_TEMPLATE_FILE variable will instead be filled in with server_stack.py by using Python's built-in template library that reads in the docker-compose file from disk.
This would allow for syntax highlighting in your IDEs when editing this compose file, and make it something easier to find in the repo.
So to summarize, this feature would include
new docker-compose.yml file with the contents present in user_data.sh
updated user_data.sh file (becomes less verbose)
updated server_stack.py file (template reads in docker-compose.yml, substitutes in MINECRAFT_SERVER_SEMANTIC_VERSION itself, and then creates the variable DOCKER_COMPOSE_TEMPLATE_FILE to template user_data.sh
In
awscdk-minecraft/awscdk-minecraft-server-deployer/resources/user-data.sh
we define the contents of a docker-compose file, butawscdk-minecraft/awscdk-minecraft-server-deployer/src/minecraft_server_deployer/server_stack.py
could (and should) instead load up adocker-compose.yml
file with these contents and template it there.We're currently "templating" with what looks like bash variables but is actually used by server_stack.py to fill in those values in the shell script.
Instead of
Would become
and the
DOCKER_COMPOSE_TEMPLATE_FILE
variable will instead be filled in with server_stack.py by using Python's built-in template library that reads in the docker-compose file from disk.This would allow for syntax highlighting in your IDEs when editing this compose file, and make it something easier to find in the repo.
So to summarize, this feature would include
docker-compose.yml
file with the contents present inuser_data.sh
user_data.sh
file (becomes less verbose)server_stack.py
file (template reads in docker-compose.yml, substitutes inMINECRAFT_SERVER_SEMANTIC_VERSION
itself, and then creates the variableDOCKER_COMPOSE_TEMPLATE_FILE
to templateuser_data.sh