Skip to content

Commit

Permalink
fix docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
chennqqi committed Aug 9, 2021
1 parent cf49d34 commit d1198a0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 29 deletions.
37 changes: 16 additions & 21 deletions docker-compose-mysql.yaml
Original file line number Diff line number Diff line change
@@ -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:
16 changes: 8 additions & 8 deletions docker-compose-sqlite.yaml
Original file line number Diff line number Diff line change
@@ -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:

0 comments on commit d1198a0

Please sign in to comment.