Docker

This part is about how to build Docker images and deploy using Docker images.

Build docker image

Download Dockerfile :

Download address: https://github.com/YaoApp/dockerfiles

git clone https://github.com/YaoApp/dockerfiles /path/root/dockerfiles

Build command:

AMD64

Build command:

docker build \
--platform linux/amd64 \
--build-arg REPO=${REPO} \
--build-arg TOKEN=${TOKEN} \
--build-arg VERSION=${VERSION} \
-t ${ORG}/${NAME}:${VERSION} .

Example:

cd /path/root/dockerfiles/application/amd64
docker build --platform linux/amd64 \
--build-arg REPO=github.com/YaoApp/yao-wms \
--build-arg TOKEN=xxxxxxxxx \
--build-arg VERSION=1.0.3 \
-t yaoapp/yao-wms:1.0.3-amd64 .

Build parameters:

parameter namedescriptionexample
REPOApplication code repository addressgithub.com/YaoApp/yao-wms
TOKENGitHub personal access token view documentationghp_xxxxxxxxxxxxxxxxxx
VERSIONApplication version number1.0.3

ARM64

Build command:

docker build \
--platform linux/arm64 \
--build-arg REPO=${REPO} \
--build-arg TOKEN=${TOKEN} \
--build-arg VERSION=${VERSION} \
-t ${ORG}/${NAME}:${VERSION} .

Example:

cd /path/root/dockerfiles/application/arm64
docker build --platform linux/arm64 \
--build-arg REPO=github.com/YaoApp/yao-wms \
--build-arg TOKEN=xxxxxxxxx \
--build-arg VERSION=1.0.3 \
-t yaoapp/yao-wms:1.0.3-arm64 .

Build parameters:

parameter namedescriptionexample
REPOApplication code repository addressgithub.com/YaoApp/yao-wms
TOKENGitHub personal access token view documentationghp_xxxxxxxxxxxxxxxxxx
VERSIONApplication version number1.0.3

Using the docker image

Environment variables

variable namedescriptionexample
YAO_INITyaoadmin start Before starting for the first time, initialize data, allow demo to initialize data, and run DEMO processing, reset initialize data. If not set, no initialization operation will be performeddemo
YAO_PROCESS_RESETyaoadmin reset The processor to run after successfully migrating dataflows.init.menu
YAO_PROCESS_DEMOyaoadmin reset --with-demo Processor for generating demo dataflows.init.menu

SQLite database

docker run -d -p 5099:5099 --restart unless-stopped \
-e YAO_INIT=demo \
-e YAO_PROCESS_RESET=flows.init.menu \
-e YAO_PROCESS_DEMO=flows.demo.data \
yaoapp/yao-wms:1.0.3-amd64

MySQL database

docker run -d -p 3307:3306 --restart unless-stopped -e MYSQL_PASSWORD=123456 yaoapp/mysql:8.0-amd64
docker run -d -p 5099:5099 --restart unless-stopped \
-e YAO_INIT=demo \
-e YAO_PROCESS_RESET=flows.init.menu \
-e YAO_PROCESS_DEMO=flows.demo.data \
-e YAO_DB_DRIVER=mysql \
-e YAO_DB_PRIMARY="yao:123456@tcp(172.17.0.1:3307)/yao?charset=utf8mb4&parseTime=True&loc=Local" \
yaoapp/yao-wms:1.0.3-amd64

Docker Compose

version: "3.9"
services:
yao:
image: yaoapp/yao-wms:1.0.3-amd64
environment:
- YAO_INIT=demo
YAO_PROCESS_RESET=flows.init.menu
YAO_PROCESS_DEMO=flows.demo.data
YAO_DB_DRIVER=mysql
YAO_DB_PRIMARY="yao:123456@tcp(mysql:3306)/yao?charset=utf8mb4&parseTime=True&loc=Local"
ports:
- "5099:509

Docker

This part is about how to build Docker images and deploy using Docker images.

Build docker image

Download Dockerfile :

Download address: https://github.com/YaoApp/dockerfiles

git clone https://github.com/YaoApp/dockerfiles /path/root/dockerfiles

Build command:

AMD64

Build command:

docker build \
--platform linux/amd64 \
--build-arg REPO=${REPO} \
--build-arg TOKEN=${TOKEN} \
--build-arg VERSION=${VERSION} \
-t ${ORG}/${NAME}:${VERSION} .

Example:

cd /path/root/dockerfiles/application/amd64
docker build --platform linux/amd64 \
--build-arg REPO=github.com/YaoApp/yao-wms \
--build-arg TOKEN=xxxxxxxxx \
--build-arg VERSION=1.0.3 \
-t yaoapp/yao-wms:1.0.3-amd64 .

Build parameters:

parameter namedescriptionexample
REPOApplication code repository addressgithub.com/YaoApp/yao-wms
TOKENGitHub personal access token view documentationghp_xxxxxxxxxxxxxxxxxx
VERSIONApplication version number1.0.3

ARM64

Build command:

docker build \
--platform linux/arm64 \
--build-arg REPO=${REPO} \
--build-arg TOKEN=${TOKEN} \
--build-arg VERSION=${VERSION} \
-t ${ORG}/${NAME}:${VERSION} .

Example:

cd /path/root/dockerfiles/application/arm64
docker build --platform linux/arm64 \
--build-arg REPO=github.com/YaoApp/yao-wms \
--build-arg TOKEN=xxxxxxxxx \
--build-arg VERSION=1.0.3 \
-t yaoapp/yao-wms:1.0.3-arm64 .

Build parameters:

parameter namedescriptionexample
REPOApplication code repository addressgithub.com/YaoApp/yao-wms
TOKENGitHub personal access token view documentationghp_xxxxxxxxxxxxxxxxxx
VERSIONApplication version number1.0.3

Using the docker image

Environment variables

variable namedescriptionexample
YAO_INITyaoadmin start Before starting for the first time, initialize data, allow demo to initialize data, and run DEMO processing, reset initialize data. If not set, no initialization operation will be performeddemo
YAO_PROCESS_RESETyaoadmin reset The processor to run after successfully migrating dataflows.init.menu
YAO_PROCESS_DEMOyaoadmin reset --with-demo Processor for generating demo dataflows.init.menu

SQLite database

docker run -d -p 5099:5099 --restart unless-stopped \
-e YAO_INIT=demo \
-e YAO_PROCESS_RESET=flows.init.menu \
-e YAO_PROCESS_DEMO=flows.demo.data \
yaoapp/yao-wms:1.0.3-amd64

MySQL database

docker run -d -p 3307:3306 --restart unless-stopped -e MYSQL_PASSWORD=123456 yaoapp/mysql:8.0-amd64
docker run -d -p 5099:5099 --restart unless-stopped \
-e YAO_INIT=demo \
-e YAO_PROCESS_RESET=flows.init.menu \
-e YAO_PROCESS_DEMO=flows.demo.data \
-e YAO_DB_DRIVER=mysql \
-e YAO_DB_PRIMARY="yao:123456@tcp(172.17.0.1:3307)/yao?charset=utf8mb4&parseTime=True&loc=Local" \
yaoapp/yao-wms:1.0.3-amd64

Docker Compose

version: "3.9"
services:
yao:
image: yaoapp/yao-wms:1.0.3-amd64
environment:
- YAO_INIT=demo
YAO_PROCESS_RESET=flows.init.menu
YAO_PROCESS_DEMO=flows.demo.data
YAO_DB_DRIVER=mysql
YAO_DB_PRIMARY="yao:123456@tcp(mysql:3306)/yao?charset=utf8mb4&parseTime=True&loc=Local"
ports:
- "5099:509