Rapid Deployment
Docker Containerized Deployment
Tools
- Docker 24.0.7
- Docker-Compose 2.24.0
Remind
Lower versions will not be able to start the container properly
Install
- Download the Docker Compose script file and execute the following command on a Linux system:
curl -o docker-compose.yml http://cat2bug.com/docker/docker-compose.yml
- According to their own needs, users can modify the configuration in the Docker Compose.yml file, and this step can also be skipped.
The following are the key points for configuration modification:
- Map database files: Configure the mapping of MySQL database files to the host's location in lines 18 and 19;
- Change database account password: Configure the root of MySQL and the account and password of regular users from lines 25 to 28. It should be noted that after changing the account and password, the connection information from lines 30, 56 to 58 also needs to be modified together (as MySQL cannot be accessed externally under the current configuration, there is no security issue, and it is not recommended to modify this item);
- Modify page port: The port accessed on the 78 line configuration page can be changed from 8022 to any port number;
version: '3.4'
name: cat2bug-platform
services:
cat2bug-platform-mysql:
image: cat2bug/cat2bug-platform-mysql:latest
hostname: mysql
container_name: cat2bug-platform-mysql
restart: always
command:
--default-authentication-plugin=mysql_native_password
--character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci
--explicit_defaults_for_timestamp=true
--lower_case_table_names=1
--interactive_timeout=259200
--wait_timeout=259200
--max_connections=1000
# volumes:
# - ./mysql-data:/var/lib/mysql
expose:
- "3306"
environment:
TZ: Asia/Shanghai
MYSQL_ROOT_HOST: "%"
MYSQL_DATABASE: cat2bug_platform
MYSQL_ROOT_PASSWORD: cat2bug_password
MYSQL_USER: cat2bug
MYSQL_PASSWORD: cat2bug_password
healthcheck:
test: "mysql -h127.0.0.1 -P3306 -uroot -pcat2bug_password -e 'SHOW DATABASES;'"
interval: 10s
timeout: 5s
retries: 6
start_period: 30s
networks:
- cat2bug-network
cat2bug-platform-redis:
image: redis:7.2.3
hostname: redis
container_name: cat2bug-platform-redis
restart: always
expose:
- "6739"
healthcheck:
test: "exit 0"
networks:
- cat2bug-network
cat2bug-platform-web-after:
hostname: after
image: cat2bug/cat2bug-platform-web-after:latest
container_name: cat2bug-platform-web-after
restart: always
expose:
- "2020"
environment:
SPRING_DATASOURCE_DRUID_MASTER_URL: jdbc:mysql://cat2bug-platform-mysql:3306/cat2bug_platform?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8
SPRING_DATASOURCE_DRUID_MASTER_USERNAME: root
SPRING_DATASOURCE_DRUID_MASTER_PASSWORD: cat2bug_password
SPRING_REDIS_HOST: cat2bug-platform-redis
links:
- cat2bug-platform-mysql
- cat2bug-platform-redis
depends_on:
cat2bug-platform-mysql:
condition: service_healthy
cat2bug-platform-redis:
condition: service_healthy
healthcheck:
test: "exit 0"
networks:
- cat2bug-network
cat2bug-platform-web-front:
hostname: front
image: cat2bug/cat2bug-platform-web-front:latest
container_name: cat2bug-platform-web-front
restart: always
ports:
- "8022:80"
links:
- cat2bug-platform-web-after
depends_on:
cat2bug-platform-web-after:
condition: service_healthy
networks:
- cat2bug-network
networks:
cat2bug-network:
driver: bridge
- Run the Docker Compose script.
docker-compose up -d
After the script runs normally, the console will return the following information:
[+] Running 4/4
✔ Container cat2bug-platform-redis Healthy 0.2s
✔ Container cat2bug-platform-mysql Healthy 0.2s
✔ Container cat2bug-platform-web-after Healthy 0.1s
✔ Container cat2bug-platform-web-front Started
The functions of each container are described as follows:
- cat2bug-platform-mysql:Database
- cat2bug-platform-redis:Cache
- cat2bug-platform-web-after:cat2bug-platform Backend Services
- cat2bug-platform-web-front:cat2bug-platform Page Services
Use
- After installation is completed, enter in the browser http://127.0.0.1:8022
- On the login page, click to register a new user and log in to use it.
Prompt
System default administrator: account: admin password: cat2bug