p 70 부터
docker 설치.. 리눅스가 답이다
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL <https://download.docker.com/linux/ubuntu/gpg> | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] <https://download.docker.com/linux/ubuntu> bionic stable"
sudo apt update
apt-cache policy docker-ce
sudo apt install docker-ce
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.send("Hello Docker Node!");
});
app.listen(3000, () => {
console.log("Success Connected at HTTP");
});
FROM node:10
RUN mkdir /node_test
RUN cd /node_test
RUN npm init -y
RUN npm install express
COPY app.js /node_test
CMD ["node", "/node_test/app.js"]
docker image build -t node_test .
docker container run -t -p 80:3000 node_test