ubuntu安装hexo

2024.04.08改为docker安装hexo,compose文件如下:

1
sudo docker compose up -d

然后访问ip+7700即可。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
version: '3'
services:
hexo:
    container_name: hexo
    image: bloodstar/hexo:latest
    hostname: hexo-learnplant
    ports:
    - "7700:4000"
    volumes:
- ./blog:/app
#env_file:
    #  - .env  # 部分公用环境变量放到这里,以是的多个docker之间共享环境变量
environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Shanghai
      - GIT_USER="learnplant"
      - GIT_EMAIL="weitung.w@gmail.com"
      # 主要为了内部npm网络访问顺利
      # - HTTP_PROXY=http://192.168.0.100:1089
      # - HTTPS_PROXY=http://192.168.0.100:1089
    restart: always
    labels:
    - "com.centurylinklabs.watchtower.enable=true"
    network_mode: bridge