Docker 部署图床应用——Lsky Pro

发布于 2023-11-22  378 次阅读


docker-compose 文件

version: '3'
services:
    lsky-pro:
        container_name: lsky-pro
        image: dko0/lsky-pro
        restart: always
        volumes:
            - /root/data/docker_data/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.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:
          - /root/data/docker_data/lsky-pro/db:/var/lib/mysql

启动

确定反代配置好,docker-compose up -d 启动,等网页能刷出来,再 docker-compose down 关闭。然后编辑文件:

  1. config/app.php 文件:
'url' => env('APP_URL', 'https://your.domain'),
'asset_url' => env('ASSET_URL', 'https://your.domain'),
  1. app/Providers/AppServiceProvider.php 文件,在 public function boot() 方法的开头增加一行: \Illuminate\Support\Facades\URL::forceScheme('https');

再去网页进行正常安装使用即可。

安装信息中,数据库连接地址为 lsky-pro-db,端口空着,数据库路径为 lsky-pro