{"id":26885297,"url":"https://github.com/fawzymokhtar/express-app-with-docker","last_synced_at":"2026-04-12T15:34:33.277Z","repository":{"id":42030249,"uuid":"253617291","full_name":"FawzyMokhtar/Express-App-With-Docker","owner":"FawzyMokhtar","description":"This project shows a simple implementation for an express app with mysql database deployed using docker.","archived":false,"fork":false,"pushed_at":"2023-02-24T22:56:49.000Z","size":86,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T18:52:29.812Z","etag":null,"topics":["docker","docker-compose","dockerize","express","mysql","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FawzyMokhtar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-06T21:15:58.000Z","updated_at":"2022-04-17T06:03:27.000Z","dependencies_parsed_at":"2023-01-27T17:31:28.720Z","dependency_job_id":null,"html_url":"https://github.com/FawzyMokhtar/Express-App-With-Docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FawzyMokhtar/Express-App-With-Docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FawzyMokhtar%2FExpress-App-With-Docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FawzyMokhtar%2FExpress-App-With-Docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FawzyMokhtar%2FExpress-App-With-Docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FawzyMokhtar%2FExpress-App-With-Docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FawzyMokhtar","download_url":"https://codeload.github.com/FawzyMokhtar/Express-App-With-Docker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FawzyMokhtar%2FExpress-App-With-Docker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271121168,"owners_count":24702723,"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","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-compose","dockerize","express","mysql","nodejs"],"created_at":"2025-03-31T18:52:32.538Z","updated_at":"2026-04-12T15:34:28.243Z","avatar_url":"https://github.com/FawzyMokhtar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Express App With Docker\n\nThis is a simple express app with mysql database deployed with docker.\n\n## Table of Content\n\n- [Prerequisites](#prerequisites)\n- [Getting Started](#getting-started)\n  - [Database Setup](#database-setup)\n  - [Start App on Development Environment](#start-app-on-development-environment)\n  - [Deploy to a Docker Container](#deploy-to-a-docker-container)\n    - [Deploy Using Docker Compose](#using-docker-compose)\n\n## Prerequisites\n\n### You should have all of the following installed before start\n\n- [Node \u003e= 12.16.1](https://nodejs.org/en/)\n\n- [Docker Engin \u003e= 19.03.8](https://docs.docker.com/install/)\n\n- [Docker Compose](https://docs.docker.com/compose/install/) (only if you will use it instead of docker).\n\n- [MySQL Server](https://www.mysql.com/) (only if you want to run this project on you local machine).\n\n- Yarn installed (globally recommended) or use `sudo npm i -g yarn` to install it.\n\n## Getting Started\n\n- ### Database Setup\n\n  1. Follow the [instructions](https://dev.mysql.com/doc/refman/8.0/en/installing.html) to setup a MySQL server on your local machine.\n\n  2. Use [workbench](https://dev.mysql.com/doc/workbench/en/) or [mysql shell](https://dev.mysql.com/doc/mysql-shell/8.0/en/) to run the following script\n\n     ```sql\n     CREATE DATABASE `express-app-with-docker-db`;\n     ```\n\n     to create an empty to be used in our express app.\n\n  3. Go to the \u003ci\u003e\"sequelize.js\"\u003c/i\u003e file located in the path \u003ci\u003e\"src/data/\"\u003c/i\u003e and make sure all credentials are right.\n\n     \u003cb\u003eImportant\u003c/b\u003e, any changes in this credentials requires a change to the files \u003ci\u003e\"Dockerfile\"\u003c/i\u003e and \u003ci\u003e\"docker-compose.yml\"\u003c/i\u003e .\n\n- ### Start App on Development Environment\n\n  1. Run command\n\n     ```bash\n     yarn start\n     ```\n\n  2. You should see this message\n     ```bash\n     Express server is up \u0026 running on port 8080\n     ```\n\n- ### Deploy to a Docker Container\n\n  - #### Using Docker Compose\n\n    - If you changed any credentials in the step [database setup](#database-setup), you should update these changes in the files \u003ci\u003e\"Dockerfile\"\u003c/i\u003e and \u003ci\u003e\"docker-compose.yml\"\u003c/i\u003e .\n\n    - Also you should update the file \u003ci\u003e\"Dockerfile\"\u003c/i\u003e and use your \u003cb\u003ehost\u003c/b\u003e machine ip address instead of mine(172.19.0.1).\n\n    - More details are included in the \u003ci\u003e\"Dockerfile\"\u003c/i\u003e and \u003ci\u003e\"docker-compose.yml\"\u003c/i\u003e files.\n\n    - To Build a Docker Image and Deploy to a Docker Container, run command\n\n      ```bash\n      docker-compose build\n      ```\n\n    - To run a docker container for every service in the built docker image (in our case two services web \u0026 db), run the command\n\n      ```bash\n      docker-compose up -d\n      ```\n\n      You will get two new containers with the name \u003cb\u003eexpress-app-with-docker_web_1\u003c/b\u003e and \u003cb\u003eexpress-app-with-docker_db_1\u003c/b\u003e\n\n    - To get the ip address for the newly created express app docker container, run command\n\n      ```bash\n      docker inspect express-app-with-docker_web_1 | grep Address\n      ```\n\n      Now you should have the following message\n\n      ```bash\n      \"LinkLocalIPv6Address\": \"\",\n           \"SecondaryIPAddresses\": null,\n           \"SecondaryIPv6Addresses\": null,\n           \"GlobalIPv6Address\": \"\",\n           \"IPAddress\": \"\",\n           \"MacAddress\": \"\",\n                   \"IPAddress\": \"172.19.0.3\",\n                   \"GlobalIPv6Address\": \"\",\n                   \"MacAddress\": \"02:42:ac:13:00:03\"\n      ```\n\n      The value of the `\"IPAddress\": \"172.19.0.3\"` is the ip address for th newly created docker container.\n\n    - To test the app, open your browser on `http://172.19.0.3:8080` or `http://localhost:8080`\n\n      You should get this message\n\n      ```json\n      [\n        {\n          \"id\": 1,\n          \"name\": \"Samsung Galaxy S5\",\n          \"price\": \"4500.00\"\n        },\n        {\n          \"id\": 2,\n          \"name\": \"Samsung Galaxy S6\",\n          \"price\": \"5000.00\"\n        },\n        {\n          \"id\": 3,\n          \"name\": \"Huawei P10 Lite\",\n          \"price\": \"5200.00\"\n        },\n        {\n          \"id\": 4,\n          \"name\": \"Huawei P30\",\n          \"price\": \"6500.00\"\n        },\n        {\n          \"id\": 5,\n          \"name\": \"Huawei P30 Lite\",\n          \"price\": \"5800.00\"\n        }\n      ]\n      ```\n\n    Or you may get a message indicates that the database server is not ready yet, don't worry and try again in 10 seconds.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffawzymokhtar%2Fexpress-app-with-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffawzymokhtar%2Fexpress-app-with-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffawzymokhtar%2Fexpress-app-with-docker/lists"}