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
| version: "3.5"
services: db: image: mariadb command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW volumes: - "./db:/var/lib/mysql" - "./mysql-init-files:/docker-entrypoint-initdb.d" environment: - "TZ=Asia/Shanghai" - "MYSQL_ROOT_PASSWORD=" - "MYSQL_DATABASE_FILE=/run/secrets/mysql_db" - "MYSQL_USER_FILE=/run/secrets/mysql_user" - "MYSQL_PASSWORD_FILE=/run/secrets/mysql_password" restart: always secrets: - mysql_db - mysql_password - mysql_user
app: image: kodcloud/kodbox ports: - 80:80 links: - db - redis volumes: - "./data:/var/www/html" environment: - "MYSQL_SERVER=db" - "MYSQL_DATABASE_FILE=/run/secrets/mysql_db" - "MYSQL_USER_FILE=/run/secrets/mysql_user" - "MYSQL_PASSWORD_FILE=/run/secrets/mysql_password" - "SESSION_HOST=redis" restart: always secrets: - mysql_db - mysql_password - mysql_user
redis: image: redis:alpine environment: - "TZ=Asia/Shanghai" restart: always
secrets: mysql_db: file: "./mysql_db.txt" mysql_password: file: "./mysql_password.txt" mysql_user: file: "./mysql_user.txt"
|