瀏覽代碼

新增docker-comse(mysql配置)

tsurumure 4 周之前
父節點
當前提交
8fa2c8f068
共有 1 個文件被更改,包括 29 次插入0 次删除
  1. 29 0
      configuration/docker/docker-compose.yml

+ 29 - 0
configuration/docker/docker-compose.yml

@@ -0,0 +1,29 @@
+version: "3.9"
+
+# Docker for Ubuntu22.04 configuration
+
+# 启动命令
+# docker-compose down
+# docker-compose up -d
+
+services:
+  # -- MySQL8.0 -----------------------
+  # mkdir -p /opt/mysql/{data,config} /opt/mysql-files
+  # chmod -R 777 /opt/mysql
+  # -----------------------------------
+  mysql8:
+    image: mysql:8.0
+    container_name: mysql8
+    restart: unless-stopped
+    environment:
+      MYSQL_ROOT_PASSWORD: fiPxHGFJldDC
+    ports:
+      - "3306:3306"
+    volumes:
+      - /opt/mysql/data:/var/lib/mysql
+      # - /opt/mysql/config/my.cnf:/etc/mysql/my.cnf
+      - /opt/mysql-files:/var/lib/mysql-files
+    command:
+      - mysqld
+      - --sql-mode=STRICT_TRANS_TABLES,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
+