Skip to content

Latest commit

 

History

History
82 lines (52 loc) · 1.53 KB

README.md

File metadata and controls

82 lines (52 loc) · 1.53 KB

©️ docker + node + mysql boilerplate 💜

A boilerplate Docker project for development with a mysql database, a node.js backend using Express

🛠️ Stack

  • nodejs: 14 + express
  • mysql: 8.0
  • docker

Docker version

We develop this boilerplate with the following docker version: 19.03.13

docker-compose version: 1.29.0

📝 Features

  • ☑️ nodejs 14 + express api
  • ☑️ mysql 8 database
  • ☑️ running this application with docker

💎 Run

Case if you have a mysql instance running, you must shutdown before run docker container:

  $ sudo service mysql stop

Then:

  $ cp .env.example .env
  $ npm run clean:cache
  $ npm run build
  $ npm run start:background

Stop container

  1. To stop running a container, first execute the following command to get container id:
  docker ps
  1. Copy the container ID and run the following command:
  docker stop <container id>

Access mysql database container

To access the database container, we must get the container id first. Run the following command:

  $ docker ps

This previous command list all active containers.

Copy mysql container id and type the following:

  $ docker exec -it <container id> bash

Then, to access database via line command:

  $ mysql -u <username> -p

👩 Author

@laisfrigerio

📄 License

This project is licensed under the MIT License - see the LICENSE.md file for details