도커로 API 서버 올리기

원문: https://www.notion.so/18c03953b25d4116ab7f09a195c92bdf?pvs=1

  1. Dockerfile 만들기

  2. docker-compose.yml 만들기

  3. 테스트 서버에 올리기

  4. 구동할 곳에 위의 docker-compose.yml 파일을 넣고 실행하면 끝이다.

[root@localhost ~]# cd /home/
[root@localhost home]# ls
test
[root@localhost home]# cd test/
[root@localhost test]# ls
docker-compose.yml  logs  transcoder  web
[root@localhost test]# cat docker-compose.yml 
version: "3.9"

services:
  test-front-end:
    ....

[root@localhost home]# ls
test
[root@localhost home]# cd test/
[root@localhost test]# ls
test-api  docker-compose.yml  logs  transcoder  web
[root@localhost test]# cat docker-compose.yml 
version: "3.9"

services:
  test-api:
    .....

[root@localhost test]# docker-compose down
[root@localhost test]# docker-compose pull
Pulling test-api        ... done
Pulling test-front-end  ... done
Pulling test-transcoder ... done
[root@localhost test]# 
[root@localhost test]# docker-compose up -d
Creating network "test_default" with the default driver
Creating test-api ... done
Creating test-front-end  ... done
Creating test-transcoder ... done
[root@localhost test]# docker network ls
NETWORK ID     NAME            DRIVER    SCOPE
114a91a93a23   test_default   bridge    local
d5a3ebe366e2   bridge          bridge    local
c43b12aed634   host            host      local
d8358e680dbd   none            null      localdocker

Comments