setup docker env - #101
Open
S1nju wants to merge 2 commits into
Open
Conversation
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.
This pull request adds Docker support for the project, enabling easy containerization and orchestration of the Python application and its MySQL database using Docker and Docker Compose. The main changes include the addition of a
Dockerfileto build the application image and adocker-compose.ymlfile to define and manage the application and database services.Dockerization:
Dockerfilethat sets up a Python 3.10 environment, installs dependencies fromrequirements.txt, and configures the container to runmain.pywith unbuffered output for real-time logging.Service Orchestration:
docker-compose.ymlfile that defines two services:bot: Builds from the local context, mounts theconfig.inifile, and waits for the database to be healthy before starting.db: Uses the official MySQL 8.0 image, sets up environment variables for database initialization, persists data with a Docker volume, and includes a healthcheck to ensure readiness before the bot starts.db_datafor persistent MySQL storage.