SHARE
TWEET

Untitled

a guest Sep 11th, 2019 344 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. version: '3'
  2.  
  3. services:
  4.   rx0:
  5.       build: .
  6.       ports:
  7.       - "8080:8080"
  8.       depends_on:
  9.       - mysql
  10.       # - redis
  11.       networks:
  12.         - code-network  
  13.       # volumes:
  14.         # - ./wait-for-it.sh:dataIvan/wait-for-it.sh
  15.   # redis:
  16.     # image: redis
  17.   mysql:
  18.     image: mysql/mysql-server:5.7
  19.     container_name: mysql-db # 容器名
  20.     # command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci #设置utf8字符集
  21.     # command: ['mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']
  22.     command: ['mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci','--init-file','/data/application/init.sql']
  23.     # command: --init-file /data/application/init.sql
  24.     # command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci mysqld --init-file /data/application/init.sql
  25.  
  26.     restart: always
  27.     environment:
  28.       MYSQL_ROOT_PASSWORD: 123456 #root管理员用户密码
  29.       MYSQL_USER: test   #创建test用户
  30.       MYSQL_PASSWORD: 123456  #设置test用户的密码
  31.       MYSQL_DATABASE: 'rockman'
  32.     ports:
  33.           - '3306:3306'  #host物理直接映射端口为6606
  34.     healthcheck:
  35.           test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
  36.           timeout: 20s
  37.           retries: 10    
  38.     volumes:
  39.           - "/Users/moony/dumps:/var/lib/mysql"  
  40.           - ./init.sql:/data/application/init.sql    
  41.           # - ./wait-for-it.sh:/wait-for-it.sh
  42.     networks:
  43.           - code-network
  44.        
  45.  
  46. networks:
  47.     code-network:
  48.         driver: bridge
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top