Browse Source

compose files add timezone

pull/48/head
yedf2 4 years ago
parent
commit
84547e8b42
  1. 5
      docker-compose.yml
  2. 10
      helper/compose.cloud.yml
  3. 10
      helper/compose.dev.yml
  4. 5
      helper/compose.mysql.yml
  5. 3
      helper/compose.postgres.yml
  6. 28
      helper/compose.qs.yml

5
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'

10
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'

10
helper/docker-compose.dev.yml → 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'

5
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'

3
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

28
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'
Loading…
Cancel
Save