用docker-compose 搭建 兰空图床

用docker-compose 搭建 兰空图床

wszx01
2024-12-14 / 0 评论 / 1 阅读

用docker-compose 搭建 兰空图床
一、docker安装

curl -fsSL https://get.docker.com | sh && ln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/local/bin

二、在VPS 输入命令创建目录

mkdir -p /home/html/lsky-pro

三、进入目录

cd /home/html/lsky-pro

四、创建配置文件

touch docker-compose.yml

配置文件中输入:

version: '3'
services:
    lsky-pro:
        container_name: lsky-pro
        image: dko0/lsky-pro
        restart: always
        volumes:
            - /home/html/lsky-pro/lsky-pro-data:/var/www/html  #映射到本地
        ports:
            - 7791:80
        environment:
            - MYSQL_HOST=mysql
            - MYSQL_DATABASE=lsky-pro
            - MYSQL_USER=lsky-pro
            - MYSQL_PASSWORD=lsky-pro

    mysql:
        image: mysql:8.1.0
        container_name: lsky-pro-db
        restart: always
        environment:
          - MYSQL_DATABASE=lsky-pro
          - MYSQL_USER=lsky-pro
          - MYSQL_PASSWORD=lsky-pro
          - MYSQL_ROOT_PASSWORD=lsky-pro
        volumes:
          - /home/html/lsky-pro/db:/var/lib/mysql

五、最后,安装即可

docker compose up -d

六、打开 http://ip:7791 配置

0

评论 (0)

取消
您是第 133467 位访客