* feat: make commands and docker compose for ORM unit tests Signed-off-by: mango <xu.weiKyrie@foxmail.com> * add changelog Signed-off-by: mango <xu.weiKyrie@foxmail.com> Signed-off-by: mango <xu.weiKyrie@foxmail.com>
125 lines
3.0 KiB
YAML
125 lines
3.0 KiB
YAML
# Copyright 2022
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
version: "3.8"
|
|
services:
|
|
# mysql5.7
|
|
mysql5:
|
|
container_name: "beego-mysql5"
|
|
image: mysql:5.7.30
|
|
ports:
|
|
- "13306:3306"
|
|
environment:
|
|
- MYSQL_ROOT_PASSWORD=1q2w3e
|
|
- MYSQL_DATABASE=orm_test
|
|
- MYSQL_USER=beego
|
|
- MYSQL_PASSWORD=test
|
|
|
|
# mysql8.0
|
|
mysql8:
|
|
container_name: "beego-mysql8"
|
|
image: mysql:8.0
|
|
ports:
|
|
- "23306:3306"
|
|
environment:
|
|
- MYSQL_ROOT_PASSWORD=1q2w3e
|
|
- MYSQL_DATABASE=orm_test
|
|
- MYSQL_USER=beego
|
|
- MYSQL_PASSWORD=test
|
|
|
|
# postgresql
|
|
postgresql:
|
|
container_name: "beego-postgresql"
|
|
image: bitnami/postgresql:latest
|
|
ports:
|
|
- "5432:5432"
|
|
environment:
|
|
- POSTGRES_USER=postgres
|
|
- POSTGRES_PASSWORD=postgres
|
|
- POSTGRES_DB=orm_test
|
|
|
|
# tidb
|
|
pd0:
|
|
image: pingcap/pd:latest
|
|
ports:
|
|
- "2379:2379"
|
|
volumes:
|
|
- ./config/pd.toml:/pd.toml:ro
|
|
- ./data:/data
|
|
- ./logs:/logs
|
|
command:
|
|
- --name=pd0
|
|
- --client-urls=http://0.0.0.0:2379
|
|
- --peer-urls=http://0.0.0.0:2380
|
|
- --advertise-client-urls=http://pd0:2379
|
|
- --advertise-peer-urls=http://pd0:2380
|
|
- --initial-cluster=pd0=http://pd0:2380
|
|
- --data-dir=/data/pd0
|
|
- --config=/pd.toml
|
|
- --log-file=/logs/pd0.log
|
|
restart: on-failure
|
|
|
|
tikv0:
|
|
image: pingcap/tikv:latest
|
|
volumes:
|
|
- ./config/tikv.toml:/tikv.toml:ro
|
|
- ./data:/data
|
|
- ./logs:/logs
|
|
command:
|
|
- --addr=0.0.0.0:20160
|
|
- --advertise-addr=tikv0:20160
|
|
- --data-dir=/data/tikv0
|
|
- --pd=pd0:2379
|
|
- --config=/tikv.toml
|
|
- --log-file=/logs/tikv0.log
|
|
depends_on:
|
|
- "pd0"
|
|
restart: on-failure
|
|
|
|
tikv1:
|
|
image: pingcap/tikv:latest
|
|
volumes:
|
|
- ./config/tikv.toml:/tikv.toml:ro
|
|
- ./data:/data
|
|
- ./logs:/logs
|
|
command:
|
|
- --addr=0.0.0.0:20160
|
|
- --advertise-addr=tikv1:20160
|
|
- --data-dir=/data/tikv1
|
|
- --pd=pd0:2379
|
|
- --config=/tikv.toml
|
|
- --log-file=/logs/tikv1.log
|
|
depends_on:
|
|
- "pd0"
|
|
restart: on-failure
|
|
|
|
tidb:
|
|
image: pingcap/tidb:latest
|
|
ports:
|
|
- "4000:4000"
|
|
- "10080:10080"
|
|
volumes:
|
|
- ./config/tidb.toml:/tidb.toml:ro
|
|
- ./logs:/logs
|
|
command:
|
|
- --store=tikv
|
|
- --path=pd0:2379
|
|
- --config=/tidb.toml
|
|
- --log-file=/logs/tidb.log
|
|
- --advertise-address=tidb
|
|
depends_on:
|
|
- "tikv0"
|
|
- "tikv1"
|
|
restart: on-failure
|