Note: This document is a work in progress. Changes will be made over time to refine and expand upon the instructions.
- Ensure you have Docker and Docker Compose installed on your machine.
-
Clone the Repository:
If you haven't already, clone this repository to your local machine.
git clone https://github.com/chanakorn-aramsak/Cu-get-Ref-backend.git
-
Navigate to the Project Root:
Change directory to the root of the project:
cd Cu-get-Ref-backend
-
Start the MySQL Server with Docker:
With Docker and Docker Compose installed, you can easily start the MySQL server:
docker-compose up
This command will read the
docker-compose.yml
file in the project root and set up the services as defined. In this case, it will pull the MySQL image (if not already present) and start a container with the settings you've specified.If you wish to run it in detached mode (in the background), use:
docker-compose up -d
-
Connecting to the MySQL Database:
You can connect to the MySQL database using any MySQL client. The database will be accessible on
localhost
at port3307
. Use the usernameuser
and the passwordpassword
to connect.Example using the MySQL command-line tool:
mysql -h 127.0.0.1 -P 3307 -u user -p
When prompted, enter the password (
password
). -
Stopping the Services:
When you're done, you can stop the MySQL server and other services using:
docker-compose down