Quick deployment
1. Quick deployment with docker-compose
docker-compose installs the applications and runtime dependencies required by FastBee on a server or local machine. Follow the steps below to complete deployment.
1.1 Upload files
Upload the project docker/data/ directory to /var/ on the server or local machine.
For the commercial version, rebuild the backend and frontend first:
- Upload the backend package to
/var/data/java/and replace the existing JAR file. - Upload the frontend build output to
/var/data/nginx/vue/and replace the existing files.
1.2 Start deployment
Enter /var/data/ and start the services:
docker-compose up -dWait until all containers are started.
1.3 Access the system
- After deployment, open the FastBee IoT platform through the server address. The default account is
admin / admin123. - EMQX is included in the deployment. Open the EMQX console through port
18083. The default account isadmin / admin123.
Tips
- Install Docker and Docker Compose on the server before using docker-compose deployment.
- For later redeployment, usually only
fastbee-admin.jarand the contents of thevuedirectory need to be replaced.
1.4 Common deployment commands
# Pull service images first. Duration depends on the network.
# Configure a local mirror source if image download is slow.
docker-compose pull
# Build and start service containers.
docker-compose up -d
# Stop and remove service containers.
docker-compose down
# Create the data directory.
mkdir /var/data
# Grant read, write, and execute permissions.
sudo chmod 777 /var/data2. Docker basics
Docker is an open-source application container engine. It allows developers to package applications and dependencies into lightweight, portable images, then run them on Linux or Windows hosts. Containers use sandbox isolation, and their runtime overhead is low.
2.1 Install Docker
Tips
- Docker images are pulled from the official registry by default. If downloads are slow, configure a faster mirror registry according to your network environment.
- Docker Desktop includes the Docker engine and Docker Compose. Servers usually install Docker Engine and Docker Compose separately.
Linux:
Windows:
- Reference tutorial. Installing WSL and Windows Terminal first is recommended.
- Docker Desktop for Windows
macOS:
2.2 Common Docker commands
docker -v # Show Docker version and verify installation.
docker ps # Show running containers.
docker ps -a # Show all containers.
docker images # Show local images.
docker info # Show Docker system information.
docker pull [image] # Pull an image.
docker run [image] # Run a container from an image.
docker restart [container] # Restart a container.
docker stop [container] # Stop a container.
docker stats [container] # Show container resource usage.
docker inspect [container] # Show container metadata.
docker logs -n 1000 [container] # Show the latest 1000 log lines.
docker exec -it [container] /bin/bash # Enter a running container.
docker-compose up -d # Run containers in docker-compose.yml in the background.
docker-compose down # Stop containers in docker-compose.yml.
docker network create -d bridge fastbee-bridge # Create a bridge network named fastbee-bridge.
docker network ls # List all networks.
docker network connect fastbee-bridge test # Connect container test to the custom network.
docker inspect fastbee-bridge # Inspect containers in the fastbee-bridge network.2.3 Docker network modes
Docker has five common network modes. Use --net=*** to specify a container network mode.
bridge Default mode. External access uses the host IP and mapped host port.
host The container uses the host network namespace.
container The container shares the network namespace of another container.
overlay Cross-host communication.
none No external network is configured. The container can only use 127.0.0.1.2.4 Docker bridge network
A bridge network allows containers to communicate with each other. If containers are started separately, create a bridge network first:
docker network create -d bridge fastbee-bridge2.5 Common Docker Compose commands
docker-compose -v # Show Docker Compose version and verify installation.
docker-compose up -d # Build and start service containers.
docker-compose down # Stop and remove service containers.
docker-compose ps # List service containers.
docker-compose start # Start service containers.
docker-compose stop # Stop running service containers.
docker-compose restart # Restart service containers.
docker-compose logs # Show service container output.
docker-compose pull # Pull images used by services.
docker-compose config # Validate and show Compose file configuration.