Skip to content

Instantly share code, notes, and snippets.

@kuc-arc-f
Last active May 29, 2022
Embed
What would you like to do?
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