apt install docker-compose
docker pull mariadb
docker pull nmtan/chevereto
创建一个目录用于存放 docker-compose.yml 文件
mkdir chevereto
touch docker-compose.yml
文件内容如下,配置了依赖的 chevereto 以及 mariadb
version: '3'
services:
db:
image: mariadb
container_name: chevereto-mysql
# 挂载容器中的mysql数据卷到本地database文件夹
volumes:
- ./database:/var/lib/mysql:rw
restart: always
networks:
- chevereto-net
# 设置容器中的mysql的root用户密码以及其他用户
environment:
MYSQL_ROOT_PASSWORD: 123
MYSQL_DATABASE: chevereto
MYSQL_USER: chevereto
MYSQL_PASSWORD: chevereto
ports:
- 9097:3306
chevereto:
depends_on:
- db
image: nmtan/chevereto
container_name: chevereto
restart: always
networks:
- chevereto-net
# 设置CHEVERETO_DB的一些参数
environment:
CHEVERETO_DB_HOST: db
CHEVERETO_DB_USERNAME: chevereto
CHEVERETO_DB_PASSWORD: chevereto
CHEVERETO_DB_NAME: chevereto
CHEVERETO_DB_PREFIX: chv_
# 挂载容器中的images文件夹到本地的chevereto_images文件夹,以及
# 将本地的conf/upload.ini配置文件挂载到容器的/usr/local/etc/php/conf.d/中
volumes:
- ${PWD}/chevereto_images:/var/www/html/images:rw
- ${PWD}/conf/upload.ini:/usr/local/etc/php/conf.d/upload.ini:rw
# 端口映射,本机:容器,需要配置安全组
ports:
- 9099:80
networks:
chevereto-net:
volumes:
database:
chevereto_images:
docker-compose up -d
docker-compose down
进入 chevereto 运行中的容器,为 images 目录开放权限,此文件夹会被用于存放图片。chevereto 启动后如果提示其它目录无访问权限,也可依照此法进行修改。
docker exec -it chevereto /bin/bash
chmod 777 /var/www/html/images
post_max_size = 100M
upload_max_filesize = 100M
server {
listen [::]:443 ssl;
listen 443 ssl;
server_name _;
client_max_body_size 100M;
location / {
proxy_pass http://127.0.0.1:9099;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-Port $remote_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header HTTP_X_FORWARDED_FOR $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_set_header X-NginX-Proxy true;
proxy_redirect default;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
url: /dashboard/settings/image-upload
dashboard > settings > image-upload > Maximum upload file size [MB]
dashboard > settings > image-upload > Maximum upload file size (guests)
还没有人评论,抢个沙发吧...