title |
---|
Deploy with Docker |
NOTE: We support Docker Image, please visit DockerHub for more information. The following steps are for building Docker Image manually.
To build the Dashboard with Docker, you simply download the Dockerfile
file from the root directory to your device (no need to download all source codes) then follow this guide.
The manager-api
and web
will be included in this build guide product.
Before using Docker to build images and start containers, make sure that the following dependencies are installed and running in your environment.
# Execute the build command in the directory where the Dockerfile is located (by default, the project root), specifying the tag manually.
$ docker build -t apisix-dashboard:$tag .
# For users in mainland China, the `ENABLE_PROXY` parameter can be provided to speed up module downloads.
$ docker build -t apisix-dashboard:$tag . --build-arg ENABLE_PROXY=true
# If you want to use the latest codes to build, you can specify the `APISIX_DASHBOARD_VERSION` parameter to `master`.
# This parameter can also be specified as branch name of a specific version, such as `v2.1.1`.
$ docker build -t apisix-dashboard:$tag . --build-arg APISIX_DASHBOARD_VERSION=master
- Preparing configuration files
Before starting the container, the configuration file conf.yaml
needs to be prepared inside the host to override the default configuration file inside the container.
Kindly note:
- Only when
conf.listen.host
is0.0.0.0
can the external network access the services within the container. conf.etcd.endpoints
must be able to access theetcd
service within the container. For example: usehost.docker.internal:2379
so that the container can accessetcd
on the host network.
- Launch the Dashboard
# /path/to/conf.yaml Requires an absolute path pointing to the configuration file mentioned above.
$ docker run -d -p 9000:9000 -v /path/to/conf.yaml:/usr/local/apisix-dashboard/conf/conf.yaml --name apisix-dashboard apisix-dashboard:$tag
- Check if the container started successfully
$ docker ps -a
If the container apisix-dashboard
is ok, visit http://127.0.0.1:9000
to use the dashboard with GUI, where the default username and password are admin
.
- Stop
$ docker stop apisix-dashboard
- Caching is not recommended when building a image multiple times.
$ docker build -t apisix-dashboard:$tag . --no-cache=true