{"id":22039549,"url":"https://github.com/mpolinowski/express-generator-app-docker","last_synced_at":"2026-04-12T06:34:43.265Z","repository":{"id":111483087,"uuid":"135058907","full_name":"mpolinowski/express-generator-app-docker","owner":"mpolinowski","description":"Linking Node.js Code to a Docker Volume","archived":false,"fork":false,"pushed_at":"2018-09-20T14:41:49.000Z","size":69,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T05:41:41.809Z","etag":null,"topics":[],"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/mpolinowski.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-27T15:31:19.000Z","updated_at":"2018-09-20T14:41:51.000Z","dependencies_parsed_at":"2023-03-13T13:40:04.668Z","dependency_job_id":null,"html_url":"https://github.com/mpolinowski/express-generator-app-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mpolinowski/express-generator-app-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fexpress-generator-app-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fexpress-generator-app-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fexpress-generator-app-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fexpress-generator-app-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpolinowski","download_url":"https://codeload.github.com/mpolinowski/express-generator-app-docker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fexpress-generator-app-docker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31706765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T06:22:27.080Z","status":"ssl_error","status_checked_at":"2026-04-12T06:21:52.710Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-30T11:11:12.086Z","updated_at":"2026-04-12T06:34:43.234Z","avatar_url":"https://github.com/mpolinowski.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Link your Node Source Code into a Docker Container\n\nAs an example, we are going to use [express-generator](https://expressjs.com/en/starter/generator.html) to scaffold a slightly more complex ([then before](https://github.com/mpolinowski/node-express-docker-starter)) [Node.js](https://nodejs.org) Web App and link this source code into a Docker Container Volume.\n\n\n\u003c!-- TOC --\u003e\n\n- [Link your Node Source Code into a Docker Container](#link-your-node-source-code-into-a-docker-container)\n  - [Create a Node.js Web App](#create-a-nodejs-web-app)\n  - [Pointing the Container Volume to our Source Code](#pointing-the-container-volume-to-our-source-code)\n\n\u003c!-- /TOC --\u003e\n\n\n## Create a Node.js Web App\n\nWe want to use express-generator to generate a basic Node Web App. We first need to install the generator globally on our machine:\n\n\n```bash\nnpm install -g express express-generator\n```\n\nWe then run express-generator to scaffold an app for use, using the [EJS Templating Engine](http://ejs.co) - check out [their website](https://expressjs.com/en/starter/generator.html) for more options - and put the source code into a folder named _express-generator-app-docker_:\n\n\n```bash\nexpress --view=ejs express-generator-app-docker\n```\n\nTo install dependencies we need to enter the created directory and run _npm install_ :\n\n```bash\ncd express-generator-app-docker \u0026 npm install\n```\n\nWe can test our web app by running _npm start_ and accessing _http://localhos:3000_ with a web browser:\n\n\n![Express App in Docker Container](./express-docker_01.png)\n\n\n## Pointing the Container Volume to our Source Code\n\nIn our [previous test](https://github.com/mpolinowski/node-express-docker-starter) we already pulled the latest Node.js Docker Images from the Docker Hub:\n\n\n![Express App in Docker Container](./express-docker_02.png)\n\n\nTo use this image, together with our Web App, we can run the following docker command:\n\n\n```bash\ndocker run -p 8080:3000 -v E:/express-generator-app-docker:/app -w \"/app\" node npm start\n```\n\nThis command will run the node docker image, expose the internal port 3000 (coming from our express app) to port 8080. To point to our source code, we need to create a Volume __-v__ from the app directory __E:/express-generator-app-docker__ (_adjust the absolute path according to your system setup_) and link it to an __/app__ directory inside the container. To execute our code inside the container, we can add __npm start__ at the end of the command - _be aware_ that you have to set the working directory to the __/app__ directory by adding __-w \"/app\"__, to run the start command from there!\n\n\n![Express App in Docker Container](./express-docker_03.png)\n\n\nThe App is now running from inside the docker container on Port 8080:\n\n\n![Express App in Docker Container](./express-docker_04.png)\n\n\nYou can go into the sites source code and edit it - changes to the express app will show up in your browser when you reload the page. That means, we can now develop a Node Application on a system that doesn't have Node.js installed on it.\n\n\nThe next step is actually put your source code into a container - which is, what we are going to try next!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpolinowski%2Fexpress-generator-app-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpolinowski%2Fexpress-generator-app-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpolinowski%2Fexpress-generator-app-docker/lists"}