diff --git a/docker-compose.yml b/docker-compose.yml index cfe8ed7..85a4429 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,12 +18,13 @@ services: image: 'mysql:5.7' environment: MYSQL_ALLOW_EMPTY_PASSWORD: 1 - TZ: Asia/shanghai + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro command: [ '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci', - '--default-time-zone=+8:00', ] ports: - '3306:3306' diff --git a/helper/compose.cloud.yml b/helper/compose.cloud.yml index 9d65062..1336052 100644 --- a/helper/compose.cloud.yml +++ b/helper/compose.cloud.yml @@ -2,6 +2,11 @@ version: '3.3' services: api: build: .. + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + extra_hosts: + - 'host.docker.internal:host-gateway' environment: IS_DOCKER: 1 DISABLE_LOCALHOST: 1 @@ -12,14 +17,15 @@ services: - ..:/app/dtm mysql: image: 'mysql:5.7' + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro environment: MYSQL_ALLOW_EMPTY_PASSWORD: 1 - TZ: Asia/shanghai command: [ '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci', - '--default-time-zone=+8:00', ] ports: - '3306:3306' diff --git a/helper/docker-compose.dev.yml b/helper/compose.dev.yml similarity index 69% rename from helper/docker-compose.dev.yml rename to helper/compose.dev.yml index 77e18a9..a576f88 100644 --- a/helper/docker-compose.dev.yml +++ b/helper/compose.dev.yml @@ -2,6 +2,11 @@ version: '3.3' services: api: image: golang:1.16.6-alpine3.14 + extra_hosts: + - 'host.docker.internal:host-gateway' + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro environment: IS_DOCKER: '1' GOPROXY: 'https://mirrors.aliyun.com/goproxy/,direct' @@ -14,14 +19,15 @@ services: working_dir: /app/work mysql: image: 'mysql:5.7' + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro environment: MYSQL_ALLOW_EMPTY_PASSWORD: 1 - TZ: Asia/shanghai command: [ '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci', - '--default-time-zone=+8:00', ] ports: - '3306:3306' diff --git a/helper/compose.mysql.yml b/helper/compose.mysql.yml index c640fa0..0c5ec71 100644 --- a/helper/compose.mysql.yml +++ b/helper/compose.mysql.yml @@ -2,14 +2,15 @@ version: '3.3' services: mysql: image: 'mysql:5.7' + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro environment: MYSQL_ALLOW_EMPTY_PASSWORD: 1 - TZ: Asia/shanghai command: [ '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci', - '--default-time-zone=+8:00', ] ports: - '3306:3306' diff --git a/helper/compose.postgres.yml b/helper/compose.postgres.yml index 11b409e..dc80e61 100644 --- a/helper/compose.postgres.yml +++ b/helper/compose.postgres.yml @@ -3,6 +3,9 @@ services: postgres: image: 'postgres:13' command: postgres --max_prepared_transactions=1000 + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro environment: POSTGRES_PASSWORD: mysecretpassword diff --git a/helper/compose.qs.yml b/helper/compose.qs.yml new file mode 100644 index 0000000..c1a4203 --- /dev/null +++ b/helper/compose.qs.yml @@ -0,0 +1,28 @@ +version: '3.3' +services: + api: + image: 'yedf/dtm' + environment: + IS_DOCKER: '1' + ports: + - '8080:8080' + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + command: ['/app/dtm/main', 'qs'] + extra_hosts: + - 'host.docker.internal:host-gateway' + db: + image: 'mysql:5.7' + environment: + MYSQL_ALLOW_EMPTY_PASSWORD: 1 + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + command: + [ + '--character-set-server=utf8mb4', + '--collation-server=utf8mb4_unicode_ci', + ] + ports: + - '3306:3306'