申请一台服务器
可以从阿里云上申请一台测试用的服务器。
安装DOCKER
http://121.43.225.141/archives/ubuntu安装DOCKER
安装DOCKER-COMPOSE
http://121.43.225.141/archives/ubuntu安装docker-compose
安装nginx
http://121.43.225.141/archives/ubuntu apt安装最新nginx
新建一个YAML文件
version: "3"
services:
halo:
image: halohub/halo:2.11
container_name: halo
restart: on-failure:3
depends_on:
halodb:
condition: service_healthy
networks:
halo_network:
volumes:
- ./halo2:/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:postgresql://halodb/halo
- --spring.r2dbc.username=halo
# PostgreSQL 的密码,请保证与下方 POSTGRES_PASSWORD 的变量值一致。
- --spring.r2dbc.password=openpostgresql
- --spring.sql.init.platform=postgresql
# 外部访问地址,请根据实际需要修改
- --halo.external-url=http://localhost:8090/
halodb:
image: postgres:15.4
container_name: halodb
restart: on-failure:3
networks:
halo_network:
volumes:
- ./db:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 10s
timeout: 5s
retries: 5
environment:
- POSTGRES_PASSWORD=openpostgresql
- POSTGRES_USER=halo
- POSTGRES_DB=halo
- PGUSER=halo
networks:
halo_network:
启动应用
docker-compose up -d
记得备案
全国互联网安全管理平台 (mps.gov.cn)
网站备案_ICP备案_备案迁移_备案-阿里云 (miit.gov.cn)