File size: 1,525 Bytes
82c1146
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fdd1575
 
82c1146
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
version: '3.8'

services:
  mysql:
    image: mysql:8.0
    container_name: smart_mysql
    restart: unless-stopped
    
    # ํ™˜๊ฒฝ ๋ณ€์ˆ˜
    environment:
      MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-1q2w3e4r}
      MYSQL_DATABASE: ${MYSQL_DATABASE:-smarteyessen_db}
      # ์„ ํƒ์ : ์ถ”๊ฐ€ ์‚ฌ์šฉ์ž ์ƒ์„ฑ
      # MYSQL_USER: smarteye_user
      # MYSQL_PASSWORD: smarteye_pass
    
    # ํฌํŠธ ๋งคํ•‘
    ports:
      - "${MYSQL_PORT:-3308}:3306"
    
    # MySQL ์„œ๋ฒ„ ์„ค์ • (UTF-8 ๊ฐ•์ œ)
    command:
      - --character-set-server=utf8mb4
      - --collation-server=utf8mb4_unicode_ci
      - --default-authentication-plugin=mysql_native_password
      - --max-connections=200
      - --sql-mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
    
    # ๋ฐ์ดํ„ฐ ์ง€์†์„ฑ (Named Volume ์‚ฌ์šฉ)
    volumes:
      - smart_mysql_data:/var/lib/mysql
      # ์ดˆ๊ธฐํ™” ์Šคํฌ๋ฆฝํŠธ (์ปจํ…Œ์ด๋„ˆ ์ตœ์ดˆ ์‹คํ–‰ ์‹œ ์ž๋™ ์‹คํ–‰)
      - ./scripts/init_db_complete.sql:/docker-entrypoint-initdb.d/01_init.sql:ro
    
    # ํ—ฌ์Šค์ฒดํฌ
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p1q2w3e4r"]
      interval: 10s
      timeout: 5s
      retries: 5
    
    # ๋„คํŠธ์›Œํฌ
    networks:
      - smarteye_network

# Named Volume ์ •์˜
volumes:
  smart_mysql_data:
    name: smart_mysql_data
    driver: local

# ๋„คํŠธ์›Œํฌ ์ •์˜
networks:
  smarteye_network:
    name: smarteye_network
    driver: bridge