diff --git a/docker-compose-mysql.yaml b/docker-compose-mysql.yaml index 74778d9..5106af8 100644 --- a/docker-compose-mysql.yaml +++ b/docker-compose-mysql.yaml @@ -1,37 +1,32 @@ -version: "3.6" #docker version>=18.02.0+ +version: "3.3" #docker version>=18.02.0+ services: godnslog: - container_name: godnslog + depends_on: + - db image: sort/godnslog - command: serve -domain yourdomain.com -4 x.x.x.x -dsn 'mysql://' + container_name: godnslog + command: serve -domain yourdomain.com -4 x.x.x.x -driver mysql -dsn 'godnslog:godnslog123@tcp(db:3306)/godnslog?charset=utf8' ports: - - "127.0.0.1:10080:8080" # reverseProxy + - "8080:8080" # reverseProxy - "53:53/udp" environment: - GIN_MODE=release restart: always - depends_on: - - db - networks: - - overlay - + db: - image: mysql + image: mysql:5.7 container_name: godnslog-mysql - restart: always + restart: always environment: - MYSQL_ROOT_PASSWORD: example - MYSQL_USER: - MYSQL_PASSWORD: - MYSQL_DATABASE: - networks: - - overlay + MYSQL_ROOT_PASSWORD: godnslogPASS + MYSQL_USER: godnslog + MYSQL_PASSWORD: godnslog123 + MYSQL_DATABASE: godnslog + MYSQL_ROOT_HOST: "0.0.0.0" volumes: - - godnslog-mysql-data:/var/lib/mysql/data + - godnslog-mysql-data:/var/lib/mysql + #- ./mysql:/docker-entrypoint-initdb.d/ -networks: - overlay: - volumes: godnslog-mysql-data: diff --git a/docker-compose-sqlite.yaml b/docker-compose-sqlite.yaml index 6c73fcd..d8022e7 100644 --- a/docker-compose-sqlite.yaml +++ b/docker-compose-sqlite.yaml @@ -1,27 +1,27 @@ -version: "3.6" #docker version>=18.02.0+ +version: "3.3" #docker version>=18.02.0+ services: - init-godnslog: image: busybox container_name: busybox - command: /bin/sh -c 'touch /backup/.initialized && chown -R 1000:1000 /backup' + command: /bin/sh -c 'touch /app/db/godnslog.db && ls /app/db && chown -R 1000:1000 /app/db' restart: "no" volumes: - - godnslog-sqlite-data:/app/sqlite + - godnslog-sqlite-data:/app/db godnslog: image: sort/godnslog container_name: godnslog + restart: always environment: - - GIN_MODE=release + - GIN_MODE=release ports: - - "127.0.0.1:8080:8080" # 反向代理模式 + - "8080:8080" # 反向代理模式 - "53:53/udp" restart: always - command: serve -domain yourdomain.com -4 x.x.x.x -dsn 'file:/app/sqlite/godnslog.db?cache=shared&mode=rwc' + command: serve -domain example.com -4 100.100.100.100 -dsn 'file:/app/db/godnslog.db?cache=shared&mode=rwc' volumes: - - godnslog-sqlite-data:/app/sqlite/godnslog.db # 持久化存储 + - godnslog-sqlite-data:/app/db # 持久化存储 volumes: godnslog-sqlite-data: