Docker 安装 nextcloud

配置文件

/docker/nextCloud/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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
version: '3'

services:
db:
image: mariadb:10.5
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- ./db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=myPassword # db.env环境变量中的相同
env_file:
- db.env

redis:
image: redis:alpine
restart: always

app:
image: nextcloud:apache
restart: always
volumes:
- ./nextcloud:/var/www/html
environment:
- VIRTUAL_HOST=nextcloud.iftrue.me
- LETSENCRYPT_HOST=nextcloud.iftrue.me
- LETSENCRYPT_EMAIL=sunzhiqi@live.com
- MYSQL_HOST=db
- REDIS_HOST=redis
env_file:
- db.env
depends_on:
- db
- redis
networks:
- proxy-tier
- default

cron:
image: nextcloud:apache
restart: always
volumes:
- ./nextcloud:/var/www/html
entrypoint: /cron.sh
depends_on:
- db
- redis

proxy:
build: ./proxy
restart: always
ports:
- 7186:80
- 37186:443
labels:
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
volumes:
- ./certs:/etc/nginx/certs:ro
- ./vhost.d:/etc/nginx/vhost.d
- ./html:/usr/share/nginx/html
- /var/run/docker.sock:/tmp/docker.sock:ro
networks:
- proxy-tier

letsencrypt-companion:
image: nginxproxy/acme-companion
restart: always
volumes:
- ./certs:/etc/nginx/certs
- ./acme:/etc/acme.sh
- ./vhost.d:/etc/nginx/vhost.d
- ./html:/usr/share/nginx/html
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- proxy-tier
depends_on:
- proxy

# self signed
# omgwtfssl:
# image: paulczar/omgwtfssl
# restart: "no"
# volumes:
# - certs:/certs
# environment:
# - SSL_SUBJECT=servhostname.local
# - CA_SUBJECT=my@example.com
# - SSL_KEY=/certs/servhostname.local.key
# - SSL_CSR=/certs/servhostname.local.csr
# - SSL_CERT=/certs/servhostname.local.crt
# networks:
# - proxy-tier

volumes:
db:
nextcloud:
certs:
acme:
vhost.d:
html:

networks:
proxy-tier:

/docker/nextCloud/db.env

1
2
3
MYSQL_PASSWORD=myPassword
MYSQL_DATABASE=nextcloud
MYSQL_USER=nextcloud

/docker/nextCloud/proxy/Dockerfile

1
2
FROM nginxproxy/nginx-proxy:alpine
COPY uploadsize.conf /etc/nginx/conf.d/uploadsize.conf

/docker/nextCloud/proxy/uploadsize.conf

1
2
client_max_body_size 10G;
proxy_request_buffering off;

启动

1
2
cd /docker/nextCloud
docker-compose
打赏
  • 版权声明: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!
  • Copyrights © 2015-2025 SunZhiqi

此时无声胜有声!

支付宝
微信