Open franciscof12 opened 7 months ago
Makefile would not be necessary since we can create a .sh An example of .sh is:
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Uso: $0 <param>"
exit 1
fi
param=$1
case $param in
"run")
docker compose up -d
;;
"stop")
docker compose down --rmi local
;;
"build")
docker compose build
;;
*)
echo "Invalid option"
;;
esac
With a .sh we ensure that it can be run on all hosts, unlike a Makefile which requires the 'make' binary to run.
Improvements
Makefile would not be necessary since we can create a .sh An example of .sh is:
#!/bin/bash if [ $# -eq 0 ]; then echo "Uso: $0 <param>" exit 1 fi param=$1 case $param in "run") docker compose up -d ;; "stop") docker compose down --rmi local ;; "build") docker compose build ;; *) echo "Invalid option" ;; esac
With a .sh we ensure that it can be run on all hosts, unlike a Makefile which requires the 'make' binary to run.
After some discussion on Discord, we decided to use Github Actions to implement Docker Compose. Makefile or .sh are no longer needed to create the image...
Objective
Tasks
Dockerfile
for the Node.js application, ensuring it's optimized for both development and production environments.docker-compose.yml
file to manage the application's services, making it easy to start the bot with a single command.Makefile
that includes commands for building the Docker image, starting and stopping the application, viewing logs, and running tests.Expected Outcome
With the addition of Docker support and a Makefile, developers can achieve a more streamlined workflow, minimizing setup time and reducing inconsistencies across different development environments. This update aims to make contributions to the project more accessible and efficient.
Additional Notes
Please ensure all configurations and code comments are in English to maintain consistency and avoid issues with special characters.