bashcurl -fsSL https://get.docker.com -o get-docker.sh&&sudo sh get-docker.sh
bashcurl -L https://github.com/docker/compose/releases/download/v2.17.3/docker-compose-linux-aarch64 | sudo tee /usr/local/bin/docker-compose >/dev/null
bashcurl -L https://github.com/docker/compose/releases/download/2.17.3/docker-compose-linux-x86_64 | sudo tee /usr/local/bin/docker-compose >/dev/null
bashsudo chmod +x /usr/local/bin/docker-compose
bashdocker -v && docker-compose -v
bashmkdir ~/halo && cd ~/halo
yamlversion: "3"
services:
halo:
image: halohub/halo:2.7.0
container_name: halo
restart: on-failure:3
depends_on:
halodb:
condition: service_healthy
networks:
halo_network:
volumes:
- ./:/root/.halo2
ports:
- "8090:8090"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8090/actuator/health/readiness"]
interval: 30s
timeout: 5s
retries: 5
start_period: 30s
command:
- --spring.r2dbc.url=r2dbc:pool:mysql://halodb:3306/halo
- --spring.r2dbc.username=root
# MySQL 的密码,请保证与下方 MYSQL_ROOT_PASSWORD 的变量值一致。
- --spring.r2dbc.password=o#DwN&JSa56
- --spring.sql.init.platform=mysql
# 外部访问地址,请根据实际需要修改
- --halo.external-url=http://localhost:8090/
# 初始化的超级管理员用户名
- --halo.security.initializer.superadminusername=admin
# 初始化的超级管理员密码
- --halo.security.initializer.superadminpassword=P@88w0rd
halodb:
image: mysql:8.0.31
container_name: halodb
restart: on-failure:3
networks:
halo_network:
command:
- --default-authentication-plugin=mysql_native_password
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_general_ci
- --explicit_defaults_for_timestamp=true
volumes:
- ./mysql:/var/lib/mysql
- ./mysqlBackup:/data/mysqlBackup
ports:
- "3306:3306"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "--silent"]
interval: 3s
retries: 5
start_period: 30s
environment:
# 请修改此密码,并对应修改上方 Halo 服务的 SPRING_R2DBC_PASSWORD 变量值
- MYSQL_ROOT_PASSWORD=o#DwN&JSa56
- MYSQL_DATABASE=halo
networks:
halo_network:
bashdocker-compose up -d
cd ~/halo && docker-compose down
cp -r ~/halo ~/halo.archive
yamlservices:
halo:
image: halohub/halo:2.6.1
container_name: halo
docker-compose pull
docker-compose up -d
mkdir -p /root/nginxproxymanager # 创建一个 npm 的文件夹 cd /root/nginxproxymanager # 进入该文件夹 vi docker-compose.yml
yamlversion: '3'
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '80:80' # 不建议修改端口
- '81:81' # 可以把冒号左边的 81 端口修改成你服务器上没有被占用的端口
- '443:443' # 不建议修改端口
volumes:
- ./data:/data # 点号表示当前文件夹,冒号左边的意思是在当前文件夹下创建一个 data 目录,用于存放数据,如果不存在的话,会自动创建
- ./letsencrypt:/etc/letsencrypt # 点号表示当前文件夹,冒号左边的意思是在当前文件夹下创建一个 letsencrypt 目录,用于存放证书,如果不存在的话,会自动创建
docker-compose up -d # -d 表示后台运行
[email protected]
密码:changeme
本文作者:我本无罪
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!