Skip to content

Instantly share code, notes, and snippets.

@kuc-arc-f
Last active May 29, 2022 07:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuc-arc-f/8d42a4ac17a72e5fa265c7aee65eec24 to your computer and use it in GitHub Desktop.
Save kuc-arc-f/8d42a4ac17a72e5fa265c7aee65eec24 to your computer and use it in GitHub Desktop.
aws ECR sample, コンテナファイルなど
node_modules
npm-debug.log
FROM node:14.15.4
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD [ "node", "server.js" ]
{
"name": "express_app",
"version": "1.0.0",
"description": "Node.js on Docker",
"author": "First Last",
"main": "server.js",
"scripts": {
"start": "node server.js"
},
"dependencies": {
"express": "^4.16.1"
}
}
'use strict';
const express = require('express');
// Constants
const PORT = 3000;
const HOST = '0.0.0.0';
// App
const app = express();
app.get('/', (req, res) => {
res.send('Hello World-123');
});
app.listen(PORT, HOST);
console.log(`Running on http://${HOST}:${PORT}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment