Widget Connector | ||
---|---|---|
|
Info | ||||
---|---|---|---|---|
| ||||
|
...
Code Block | ||
---|---|---|
| ||
version: '3' services: redisspring-demo: container_name: spring-demo image: sooabia/spring-demo: redis 1.0 restart: always ports: - "6379:6379"'80:8080' volumeslinks: - /redis:/data/redis restartredis: always spring-demo:container_name: redis image: sooabia/spring-demo:1.0 restart: alwaysredis ports: - '80:8080'"6379:6379" linksvolumes: - ./redis:/data/redis restart: always |
Redis Volume 폴더 생성
Code Block |
---|
## redis volume을 위한 폴더를 생성합니다.
[root@workspace-vm deploy]# mkdir ./redis |
멀티 컨테이너 실행
Code Block |
---|
## Docker compose로 멀티 컨테이너를 실행합니다. [root@workspace-vm deploy]# docker-compose up -d Creating network "deploy_default" with the default driver Creating deploy_redis_1 ... done Creating deploy_reactorspring-demo_1 ... done [root@workspace-vm deploy]# [root@workspace-vm deploy]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES fc98d294e435 sooabia/spring-demo:1.0 "java -jar /app.jar" 8 seconds ago Up 6 seconds 0.0.0.0:80->8080/tcp deploy_reactorspring-demo_1 9ebfffd30318 redis "docker-entrypoint.s 9 seconds ago Up 7 seconds 0.0.0.0:6379->6379/tcp deploy_redis_1 [root@workspace-vm deploy]# |
...
Code Block |
---|
## Docker compose 멀티 컨테이너를 정리 합니다. [root@workspace-vm deploy]# docker-compose down Stopping deploy_reactorspring-demo_1 ... done Stopping deploy_redis_1 ... done Removing deploy_reactorspring-demo_1 ... done Removing deploy_redis_1 ... done Removing network deploy_default [root@workspace-vm deploy]# [root@workspace-vm deploy]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES [root@workspace-vm deploy]# |
...