Add Docker containerization - #14
Open
Pictor13 wants to merge 7 commits into
Open
Conversation
as users might confuse the name of the app with the name of the database schema. The schema is always the same, regardless of the name of the database or the name of the app bot.
to set the default bot name to use, in case a single instance of the app is being run, or when there is no environment variable set. And update the README.
for 'json' field that was previously added to the db schema, without updating the sql queries.
utilising the new recommended way: pooling connections Read about it at https://www.npmjs.com/package/mysql#pooling-connections
and specify how to handle the newlines on different platforms, when checking out shell scripts (for Unix or Windows). Without this setting checked out in the repository, users that clone the project over Windows will have problems running scripts into Docker containers, because files are being copied on it with the wrong line-ending (Unix use LF; Windows uses CRLF).
Use `docker-compose up` to initialize the 3 containers (1 for the database service and 2 for the different versions of the application). Ensure that the `docker-compose.yml` is correctly configured according to the instructions from the README. Tested on MacOS 10.14.6 (Pictor13) & Windows 10 (BotPartigiano).
Author
|
There are also some other little thing to fix (I leave some notes here as reminder; not expecting you to be able to understand them all ):
For the rest it should be usable, a decent base to have a streamlined development/production system, with single database service. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ciao @ojoven,
me and @botpartigiano added a Docker environment for the app.
It requires a (decently recent) version of Docker, and can be run with
docker-compose up --build.It will spawn 1 container for the database service and 1 container for each version of the application (bot & view),
so they can run in parallel.
I tried to update the Spanish instructions as best as possible, but maybe it needs a review from a mothertongue 😅
Please, would be great if you could take a look at it, or simply try to run the images and give feedback if any problem arises.
Atm I aim more to get it run everywhere correctly, before thinking to a merge in master.
I dunno if you are confident with docker, but don't hesitate to ask if you have questions 🙃
Note: We tested on Windows and MacOS machines, and it runs. It might be that some platforms still need to be revised;
in particular potential issues with running scripts with different line-endings.