{"id":15906273,"url":"https://github.com/softchris/node-api-sequelize","last_synced_at":"2026-02-07T09:31:54.084Z","repository":{"id":42359044,"uuid":"154906858","full_name":"softchris/node-api-sequelize","owner":"softchris","description":"example of an API using sqlite, sequelize, docker","archived":false,"fork":false,"pushed_at":"2022-12-09T05:53:55.000Z","size":131,"stargazers_count":0,"open_issues_count":10,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-02T19:44:47.411Z","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/softchris.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":"2018-10-27T00:03:14.000Z","updated_at":"2019-06-27T06:26:30.000Z","dependencies_parsed_at":"2023-01-25T17:00:13.399Z","dependency_job_id":null,"html_url":"https://github.com/softchris/node-api-sequelize","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/softchris/node-api-sequelize","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softchris%2Fnode-api-sequelize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softchris%2Fnode-api-sequelize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softchris%2Fnode-api-sequelize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softchris%2Fnode-api-sequelize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/softchris","download_url":"https://codeload.github.com/softchris/node-api-sequelize/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softchris%2Fnode-api-sequelize/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29191399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T07:37:03.739Z","status":"ssl_error","status_checked_at":"2026-02-07T07:37:03.029Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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-10-06T13:22:07.496Z","updated_at":"2026-02-07T09:31:54.071Z","avatar_url":"https://github.com/softchris.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dockerfile\n\nThis is a file called `Dockerfile` which allows us to specify how to build a container. Let's have a look at one:\n\n```\nFROM \u003cimage\u003e\n```\n\nThis means we pull down an image that we base this on, this is usually an image that is based on an OS like Ubuntu for example. Let's take an image where nodejs is pre installed, like so:\n\n```\nFROM node:8\n```\n\nNow let's set a working directory for our app. This is where all the files will be placed. It's done with the `WORKDIR` command:\n\n```\nWORKDIR /usr/src/app\n```\n\nNext step is copying over the `package.json` file as it contains instructions for what NPM modules our app needs, like so:\n\n```\nCOPY package*.json ./\n```\n\nAfter that we need to actually install the libraries like so:\n\n```\nRUN npm install\n```\n\nNow let's copy the entire app. We want all the files to end up in our work directory so we write:\n\n```\nCOPY . .\n```\n\nfrom current directory into `WORKDIR`\n\nNow let's expose a port in which you can find our application:\n\n```\nEXPOSE 8080\n```\n\nLastly start up our app by calling\n\n```\nCMD [\"npm\", \"start\"]\n```\n\nLet's show the `Dockerfile` in its entirety:\n\n```\nFROM node:8\nWORKDIR /usr/src/app\n\nCOPY package*.json ./\n\nRUN npm install\n\n# Bundle app source\nCOPY . .\n\nEXPOSE 8080\n\nCMD [ \"npm  \", \"start\" ]\n```\n\n# build\n\nNext step is to build our `Dockerfile` and create an image. Once we have an image we can start a container from it. For that we will use the `docker build` command, like so:\n\n```\ndocker build -t \u003cyour username\u003e/node-web-app .\n```\n\nWe use the `-t` to tag, give it a name. Let's inspect by running\n\n```\ndocker images\n```\n\nThis should list our image with the name we tagged it with.\n\n# run\n\nNow let's create a container from our image so we can actually is ut for something. We do that with the following command:\n\n```\ndocker run -p 49160:8080 -d \u003cyour username\u003e/node-web-app\n```\n\nLet's break apart this a bit `-p` means that we are creating a bridge between our host OS and our container. What we are saying is which port on our container should connect to what port in the container. The syntax looks like this:\n\n```\n-p \u003cport on our system\u003e:\u003cexposed container port\u003e\n```\n\nBy typing\n\n```\n-p 49160:8080\n```\n\nWe are saying we can find the app running at `http://localhost:49160`\nOR we can use `curl`, like so:\n\n```\ncurl -i localhost:49160\n```\n\nWe have already said in `app.js` that we aim to run our express server on port 8080 and expose the same port in the `Dockerfile`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftchris%2Fnode-api-sequelize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftchris%2Fnode-api-sequelize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftchris%2Fnode-api-sequelize/lists"}