{"id":14969080,"url":"https://github.com/aloiscrr/nodejs-mariadb-container","last_synced_at":"2026-01-27T20:12:07.214Z","repository":{"id":42237026,"uuid":"260363019","full_name":"AloisCRR/nodejs-mariadb-container","owner":"AloisCRR","description":"Docker container with mariadb image to have isolated environment inside a server.","archived":false,"fork":false,"pushed_at":"2022-12-14T05:35:59.000Z","size":41,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-09T22:33:04.635Z","etag":null,"topics":["docker","docker-container","docker-image","mariadb","mariadb-server","nodejs"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AloisCRR.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-01T02:26:39.000Z","updated_at":"2023-03-07T07:05:57.000Z","dependencies_parsed_at":"2023-01-28T17:15:59.176Z","dependency_job_id":null,"html_url":"https://github.com/AloisCRR/nodejs-mariadb-container","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AloisCRR%2Fnodejs-mariadb-container","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AloisCRR%2Fnodejs-mariadb-container/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AloisCRR%2Fnodejs-mariadb-container/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AloisCRR%2Fnodejs-mariadb-container/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AloisCRR","download_url":"https://codeload.github.com/AloisCRR/nodejs-mariadb-container/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182337,"owners_count":20897379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-container","docker-image","mariadb","mariadb-server","nodejs"],"created_at":"2024-09-24T13:41:06.102Z","updated_at":"2026-01-27T20:12:07.182Z","avatar_url":"https://github.com/AloisCRR.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node.js API with MariaDB container\n\nThis is a guide on how I (a beginner) connected a Node.js API with a Docker MariaDB container.\n\n## Run Locally\n\nIt's important to say I worked with **Ubuntu 19.10** for this project.\n\n1. Install all:\n\n   - [Docker](https://docs.docker.com/engine/install/ubuntu/)\n   - [Docker mariadb/server image](https://hub.docker.com/r/mariadb/server)\n   - [Node JS](https://github.com/nodesource/distributions/blob/master/README.md#debinstall)\n\n   To quickly install all requirements, create a `install.sh` file and place it whatever you want. You can use any text editor, the important thing is place inside `install.sh` all commands provided by installation page linked above. It should look like this, docker example:\n\n   ```bash\n   apt-get remove docker docker-engine docker.io containerd runc\n   sudo apt-get update\n   sudo apt-get install \\\n      apt-transport-https \\\n      ca-certificates \\\n      curl \\\n      gnupg-agent \\\n      software-properties-common\n   curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -\n   sudo add-apt-repository \\\n      \"deb [arch=amd64] https://download.docker.com/linux/ubuntu \\\n      $(lsb_release -cs) \\\n      stable\"\n   sudo apt-get update\n   sudo apt-get install docker-ce docker-ce-cli containerd.io\n   ```\n\n   Once you have copied all commands, open terminal at location you saved the script, then type `bash install.sh` and it will automatically install everything.\n\n2. Getting started:\n\n   Once you have all installed, you can clone repo or fresh start, just open a terminal in folder you have the project and type:\n\n   - `npm install` to install all dependencies.\n\n   - Run mariadb/server image\n\n     - `sudo docker run -p 3306:3306 --name maria -e MARIADB_ROOT_PASSWORD=password mariadb/server:10.4`\n     - If you have more than one instance of mysql or mariadb running, you can change **3306**:3306 that port to other not in use.\n\n   - You have connected to docker container.\n\n3. Managing mariadb without client installed\n\n   - `sudo docker exec -it maria bash` to execute terminal inside container.\n   - `mysql -u root -p` to access database (have to enter same password of `MARIADB_ROOT_PASSWORD=password`)\n   - Now you are inside of mysql, you can perform any query.\n\nThat is pretty much all, only thing you have to do is insert more data to mariadb maybe with **post** route and form in a web page, but this is like a boilerplate example.\n\n## Tech Stack\n\n| Name                                                                                                                                          | Description       |\n| --------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- |\n| [Docker](https://docs.docker.com/get-started/overview/#:~:text=Docker%20is%20an%20open%20platform,ways%20you%20manage%20your%20applications.) | Container service |\n| [Node.js](https://nodejs.org/es/about/)                                                                                                       | HTTP Server       |\n| [MariaDB](https://mariadb.com/kb/en/about-mariadb-software/#:~:text=MariaDB%20is%20an%20open%2Dsource,the%20founders%20of%20MySQL%20AB.)      | Database          |\n\n## Roadmap\n\n- [x] API connected to docker container\n- [ ] Dockerfile\n- [ ] Upload to some container registry\n- [ ] Deploy the app\n- [ ] CI/CD\n\n## Appendix\n\nI was getting an error when trying to get the data, was an error like _\"Error establishing a database connection\"_, doesn't remember exactly, but I solved that using [this guide](https://hackernoon.com/getting-started-with-mariadb-using-docker-and-nodejs-fo433yp2).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faloiscrr%2Fnodejs-mariadb-container","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faloiscrr%2Fnodejs-mariadb-container","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faloiscrr%2Fnodejs-mariadb-container/lists"}