$ docker run --name seata-server -p 8091:8091 seataio/seata-server:1.4.2
$ docker run --name seata-server \ -p 8091:8091 \ -e SEATA_IP=192.168.1.1 \ -e SEATA_PORT=8091 \ seataio/seata-server
Example of docker-compose.yaml
version: "3" services: seata-server: image: seataio/seata-server hostname: seata-server ports: - "8091:8091" environment: - SEATA_PORT=8091 - STORE_MODE=file
$ docker exec -it seata-server sh
$ docker logs -f seata-server
Custom configuration implement by mount registry.conf
and file.conf
to container.
The environment variableSEATA_CONFIG_NAME
is required when use a custom configuration , and the value must be started with file:
like file:/root/seata-config/registry
:
$ docker run --name seata-server \ -p 8091:8091 \ -e SEATA_CONFIG_NAME=file:/root/seata-config/registry \ -v /User/seata/config:/root/seata-config \ seataio/seata-server
The param -e
specify environment, and the param -v
specify mount volume.
If you need specify file.conf
, just modify config
like below in registry.conf
file:
config { type = "file" file { name = "file:/root/seata-config/file.conf" } }
You can modify configuration of seata-server by the environment variables like this:
The variable is optional, specifies registry IP instead of the container IP in registry center like eureka or others.
The variable is optional, specifies seata-server port, default is
8091
The variable is optional, specifies the log store mode of seata-server, support
db
andfile
, default isfile
.
The variable is optional, specifies the seata-server node ID, like
1
,2
,3
..., default is1
The variable is optional, specifies the seata-server environment, like
dev
,test
etc. Then server will find file likeregistry-dev.conf
under the configuration path when start.
The variable is optional, specifies the configuration file path, like the
file:/root/registry
, will load file/root/registry.conf
as configuration. If need specifyfile.conf
configuration,theconfig.file.name
value inregistry.conf
file need to change as related config, likefile:/root/file.conf