Docker compose 설치
저장소를 통해 설치
1
sudo apt-get install docker-compose-plugin
수동 설치
1
2
3
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
1
docker-compose -v
이후 정상 설치되었는지 확인한다
docker-compose.yml 파일 작성
1
2
3
4
5
6
7
8
9
10
11
12
13
version: "3"
services:
your-service:
image: node
container_name: your-web-service
restart: unless-stopped
tty: true
stdin_open: true
ports:
- "8080:80"
working_dir: /web-service
command: bash -c "npm start"
예시
명령어
1
2
3
4
5
6
alias dc='docker-compose'
alias dcbuild='docker-compose build'
alias dcup='docker-compose up'
alias dcdown='docker-compose down'
alias dcsart='docker-compose start'
alias dcstop='docker-compose stop'