创建.sh文件
#!/bin/bash
URL="http://ip地址"
IP="ip地址"
PORT="47070"
USER="登录账号"
PASS="登录密码"
echo "你的harbor地址为:"$URL
echo "你的harbor账号为:"$USER
echo "下面开始导入镜像,请稍等......"
docker login -u $USER -p $PASS $URL:$PORT
echo "开始拉取镜像"
#harbor上复制的下载路径
docker pull frondend
docker pull backend
docker pull minio
docker pull redis
docker pull mysql
echo "拉取完成,开始运行镜像"
docker-compose up -d
创建docker-compose.yml文件
version: "3"
services:
redis:
image: redis
container_name: redis01
ports:
- "6389:6379" #访问的端口:映射的端口
minio:
image: minio
container_name: minio01
volumes:
- /home/test/miniohost:/home/test/minio/data #本机路径:服务器路径
environment:
MINIO_ROOT_USER: "root"
MINIO_ROOT_PASSWORD: "123456"
ports:
- "7099:7099"
- "7090:7090" #minio需要有两个访问路径,web 7090 和api 7099
command: server /data --console-address ":7090" -address ":7099"
tasc_backend:
image: backend
container_name: backend01
ports:
- "4901:4900"
depends_on:
- redis
- minio
tasc_fronend:
image: frondend
container_name: frondend01
ports:
- "1021:1020"