我正在使用Wonderfall nextcloud image通过撰写文件进行部署。使用docker堆栈部署时,它似乎不会填充变量。
我已经尝试过多次部署,但我没有运气
version: '3.3'
networks:
prodnet:
external: true
services:
nextcloud:
image: wonderfall/nextcloud
depends_on:
- nextcloud-db # If using MySQL
- redis # If using Redis
ports:
- 8888:8888
deploy:
replicas: 1
placement:
constraints: [node.role == worker]
environment:
- UID=1100
- GID=1100
- UPLOAD_MAX_SIZE=10G
- APC_SHM_SIZE=128M
- OPCACHE_MEM_SIZE=128
- CRON_PERIOD=15m
- TZ=America/New_York
- ADMIN_USER=cloudadmin # Don't set to configure through browser
- ADMIN_PASSWORD=verycomplexpassword # Don't set to configure through browser
- DOMAIN=www.blah.com
- DB_TYPE=mysql
- DB_NAME=nextcloud
- DB_USER=wonderfall
- DB_PASSWORD=supersecretpassword
- DB_HOST=nextcloud-db
volumes:
- nextcloud_data:/data
- nextcloud_config:/config
- nextcloud_apps:/apps2
- nextcloud_themes:/nextcloud/themes
networks:
- prodnet
# If using Redis
redis:
image: redis:alpine
volumes:
- nextcloud_redis:/data
networks:
- prodnet
# If using MySQL
nextcloud-db:
image: mysql:latest
command: --default-authentication-plugin=mysql_native_password
ports:
- 3307:3306
deploy:
replicas: 1
placement:
constraints: [node.role == worker]
volumes:
- nextcloud_mysql:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=supersecretpassword
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=wonderfall
- MYSQL_PASSWORD=supersecretpassword
networks:
- prodnet
volumes:
nextcloud_data:
driver: local
driver_opts:
type: nfs
o: addr=xxxxxxxxxxxxx,hard,nolock,rw
device: ":/mnt/array1/docker/nextcloud1/data"
nextcloud_config:
driver: local
driver_opts:
type: nfs
o: addr=xxxxxxxxxxxxx,hard,nolock,rw
device: ":/mnt/array1/docker/nextcloud1/config"
nextcloud_apps:
driver: local
driver_opts:
type: nfs
o: addr=xxxxxxxxxxxxx,hard,nolock,rw
device: ":/mnt/array1/docker/nextcloud1/apps2"
nextcloud_themes:
driver: local
driver_opts:
type: nfs
o: addr=xxxxxxxxxxxxx,hard,nolock,rw
device: ":/mnt/array1/docker/nextcloud1/themes"
nextcloud_redis:
driver: local
driver_opts:
type: nfs
o: addr=xxxxxxxxxxxxx,hard,nolock,rw
device: ":/mnt/array1/docker/nextcloud1/redis"
nextcloud_mysql:
driver: local
driver_opts:
type: nfs
o: addr=xxxxxxxxxxxxx,hard,nolock,rw
device: ":/mnt/array1/docker/nextcloud1/mysql"
部署了映像,但它是默认设置,并尝试使用SQLite,而不是配置。我遵循Wonderfall github页面的指导方针,但它不起作用。
你需要更多地缩进redis
和nextcloud-db
定义,它们应该与nextcloud
处于同一水平,而不是与services
处于同一水平。
[...]
services:
nextcloud:
image: wonderfall/nextcloud
[...]
# If using Redis
redis:
image: redis:alpine
[...]
# If using MySQL
nextcloud-db:
image: mysql:latest
[...]
请参阅Dockerhub上的示例。