-
Notifications
You must be signed in to change notification settings - Fork 0
Docker
Jo Hyun Jun edited this page Feb 10, 2023
·
1 revision
이를 통해서 무중단 배포가 가능해졌으며 사용자에게 서버 중단없이 쾌적한 서비스를 제공할 수 있다는 이점이 생겼습니다.
version: '3.6'
services:
# 기숙사 공지사항
kw-dormitory-notice-batch-service:
image: rhlehfndvkd7557/kw-dormitory-notice-batch:2
ports:
- "8884:8884"
restart: always
deploy:
replicas: 1
networks:
- dormitory_batch_mysql
kw-dormitory-notice-mvc-service:
image: rhlehfndvkd7557/kw-dormitory-notice-mvc:5
ports:
- "8883:8883"
restart: always
deploy:
replicas: 3
networks:
- dormitory_mvc_mysql
kw-dormitory-mysql-server:
image: mysql:8.0
container_name: kw-dormitory-mysql-server
restart: always
ports:
- "3999:3306"
environment:
MYSQL_ROOT_PASSWORD: 루트 비밀번호
MYSQL_USER: 사용자 이름
MYSQL_PASSWORD: 비밀번호
MYSQL_DATABASE: 데이터베이스 이름
TZ: Asia/Seoul
volumes:
- ./db/data:/var/lib/mysql
- ./db/init:/docker-entrypoint-initdb.d
command: ['mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.hostname == 호스트이름
networks:
- dormitory_batch_mysql
- dormitory_mvc_mysql
networks:
dormitory_mvc_mysql:
driver: overlay
dormitory_batch_mysql:
driver: overlay