docker-compose.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
version: '3'

services:
chevereto:
image: nmtan/chevereto
restart: always
networks:
- private
environment:
CHEVERETO_DB_HOST: <你的mysql地址>
CHEVERETO_DB_PORT: <你的mysql端口>
CHEVERETO_DB_USERNAME: <你的mysql用户名>
CHEVERETO_DB_PASSWORD: <你的mysql密码>
CHEVERETO_DB_NAME: chevereto
CHEVERETO_DB_PREFIX: chv_
volumes:
- ./images:/var/www/html/images:rw
- ./chevereto.ini:/usr/local/etc/php/conf.d/chevereto.ini
ports:
- 8388:80

networks:
private:

扩展图像大小

默认情况下,chevereto仅支持最大为2MB的图像上传,根据官网(Max image size)的描述,这是由于PHP语言的限制,需要额外编写配置文件。参考:

Chevereto supports only 2MB Max Upload size

need help with php.ini and its upload limit size for a docker container

docker 的官方PHP镜像 如何修改 php.ini 配置

在docker-compose.yml同一路径下编辑配置文件chevereto.ini

chevereto.ini

1
2
3
4
5
6
7
memory_limit = 256M;

upload_max_filesize = 100M;

post_max_size = 100M;

max_execution_time = 60;

部署

1
docker-compose up -d