1、Docker、Docker-Compose安装
https://www.cnblogs.com/a120608yby/p/9883175.html
https://www.cnblogs.com/a120608yby/p/14582853.html

2、基于Docker-Compose部署nextcloud

# vim docker-compose.yml 
version: '3'

services:
  db:
    image: mariadb:10.6
    container_name: db
    restart: always
    networks:
      - ops_default
    command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
    volumes:
      - ./db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=Admin-123
      - MYSQL_PASSWORD=Admin-123
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  app:
    image: nextcloud
    container_name: app
    restart: always
    networks:
      - ops_default
    ports:
      - 8080:80
    links:
      - db
    volumes:
      - ./nextcloud:/var/www/html
    environment:
      - MYSQL_PASSWORD=Admin-123
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db

networks:
  ops_default:
    external: true

3、启动服务

docker-compose up -d

4、查看服务启动状态

docker-compose ps

参考:

https://github.com/nextcloud/docker

  

posted on 2024-03-07 11:07  a120608yby  阅读(66)  评论(0编辑  收藏  举报