- cd && mkdir caddy && cd caddy && vim Caddyfile
example.com{
proxy / 1.1.1.1:2333{
proxy_header Host {host}
proxy_header X-Real-IP {remote}
proxy_header X-Forward-Proto{scheme}
}
log /var/log/caddy.log
gzip
}
复制粘贴到Caddyfile中,example.com替换为用户的域名,1.1.1.1换成服务器ip,2333设置成想要的端口- cd && mkdir owncloud && cd owncloud &&vim docker-compose.yml
- 将下面的复制到docker-compose.yml
Sqlite版本:
owncloud:
image:owncloud
volumes:
- ~/cloud/config:/opt/owncloud/config
- ~/cloud/data:/opt/owncloud/data
ports:
- 2333:80
caddy:
image: abiosoft/caddy
volumns:
- ~/caddy/Caddyfile:/etc/Caddyfile
- ~/.caddy:/root/.caddy
ports:
- 80:80
- 443:443
MYSQL版本:
version: '2'
services:
db:
container_name: db
image:mysql:5.7
volumes:
- "~/mysql:/var/lib/mysql"
restart:always
environment:
MYSQL_ROOT_PASSWORD:这里填密码
MYSQL_DATABASE: owncloud
MYSQL_USER:这里填数据库用户名
MYSQL_PASSWORD:这里还是填密码
owncloud:
container_name:owncloud
depends_on:
- db
image: owncloud:latest
volumes:
- ~/cloud/config:/var/www/html/config
- ~/cloud/data:/var/www/html/data
links:
- db
ports:
- "2333:80"
restart:always
- docker-compose up -d
利用docker-compose搭建私有云储存ownCloud博客系统
发布于 2022-02-22 2078 次阅读
Comments NOTHING