음... 오늘은 강의를 들으러 열심히 왔는데 어제 빠졌던 타격이 커서 뭔가 오늘 수업이 딱히 의미가 없을 것 같습니다.

 

 이전에 Docker Quickstart Terminal를 설치하여 수업을 진행하신 것 같습니다.

 

========================================  1  ========================================

[ 19 : 00 ~ 19 : 45

 

 

Mingw64







 

========================================  2  ========================================

[ 20 : 00 ~ 20 : 45 

 

 

간단하게 어제 수업을 정리해서 훑어주셨습니다. 그리고 난 후 강의를 시작하셨습니다.

 

강의자료 55페이지(4장 Docker 저장소)부터 수업을 진행하셨습니다. 

 



 

========================================  3  ========================================

[21 : 00 ~ 21 : 45 

 

https://raw.githubusercontent.com/th-lee/docker-lec/master/deploy/deploy.sh

BASE_SITE=docker.kosta.com
# test
export NODE_ENV=test
export PORT=8001
export VIRTUAL_HOST=$NODE_ENV.$BASE_SITE
docker-compose -p ${VIRTUAL_HOST} up -d

# stage
export NODE_ENV=stage
export PORT=8002
export VIRTUAL_HOST=$NODE_ENV.$BASE_SITE
docker-compose -p ${VIRTUAL_HOST} up -d

# prod
export NODE_ENV=prod
export PORT=8003
export VIRTUAL_HOST=$BASE_SITE
docker-compose -p ${VIRTUAL_HOST} up -d

https://raw.githubusercontent.com/th-lee/docker-lec/master/deploy/docker-compose.yml

version: '3'

services:
  web:
    build: ./app/
    environment:
      - NODE_ENV=${NODE_ENV}
      - PORT=${PORT}
      - VIRTUAL_HOST=${VIRTUAL_HOST}
      - VIRTUAL_PORT=${PORT}
    ports:
      - "192.168.137.101:${PORT}:80"

networks:
  default:
    external:
      name: service-network

 

2개는 놓쳤습니다.
 

https://raw.githubusercontent.com/th-lee/docker-lec/master/deploy/app/Dockerfile

# Start from a standard nodejs image
FROM node

# Copy in the node app to the container
COPY ./server.js /app/server.js
WORKDIR /app

# Allow http connections to the server
EXPOSE 80

# Start the node server
CMD ["node", "server.js"]

https://raw.githubusercontent.com/th-lee/docker-lec/master/deploy/app/server.js

 

var http = require('http');

var server = http.createServer(function(req, res){
    res.writeHead(200, {"Content-Type": "text/plain"});
    res.end(`
Hello World!

VIRTUAL_HOST: ${process.env.VIRTUAL_HOST}
NODE_ENV: ${process.env.NODE_ENV}
PORT: ${process.env.PORT}

`.split('/n').join('<br>'));
});

server.listen(80);


+ Recent posts