Back

OpenMediaVault创建容器

此文介绍根据omv系统安装各种容器应用

要创建的容器有:

Mariadb: 关系型数据库,mysql的开源版本

Adminer:开源的数据库管理软件

Gitea:开源的私人代码版本管理器

Flarum:开源的论坛

WordPress:开源的博客软件

NextCloud:开源的私人网盘软件

1.在一个分区上创建我们需要的文件夹存放配置文件

文件夹创建

2.在终端拉取上面的各个镜像文件

1.flarum

docker pull mondedie/flarum:latest

2.wordpress

docker pull wordpress

3.adminer

docker pull adminer

4.mariadb

docker pull mariadb

5.gitea

docker pull gitea/gitea

6.nextcloud

docker pull nextcloud

3.创建各个容器

按顺序应该创建数据库软件与数据库管理软件 database

1.mariadb容器创建参考

container_name: mariadb
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=1
      - TZ=Asia/Shanghai
    volumes:
      - /srv/dev-disk-by-id-ata-VBOX_HARDDISK_VBdf1e9e6f-f90961e1-part1/mariadb/config:/config
    ports:
      - 3306:3306
    networks:
      - mynet
    restart: always

networks:
  mynet:
    external:
      name: mynet

2.adminer创建参考

container_name: adminer
    environment:
      - ADMINER_DEFAULT_SERVER=mariadb
    ports:
      - 8080:8080
    networks:
      - mynet
    restart: always

networks:
  mynet:
    external:
      name: mynet

3.flarum创建参考

3.1在映射的flarum根目录创建docker-compose.yaml
version: "3"

services:
  flarum:
    image: mondedie/flarum:stable
    container_name: flarum
    env_file:
      - /srv/dev-disk-by-id-ata-VBOX_HARDDISK_VBdf1e9e6f-f90961e1-part1/flarum/flarum.env
    volumes:
      - /srv/dev-disk-by-id-ata-VBOX_HARDDISK_VBdf1e9e6f-f90961e1-part1/flarum/assets:/flarum/app/public/assets
      - /srv/dev-disk-by-id-ata-VBOX_HARDDISK_VBdf1e9e6f-f90961e1-part1/flarum/extensions:/flarum/app/extensions
      - /srv/dev-disk-by-id-ata-VBOX_HARDDISK_VBdf1e9e6f-f90961e1-part1/flarum/nginx:/etc/nginx/flarum
      - /mnt/docker/flarum/storage/logs:/flarum/app/storage/logs
    ports:
      - 8081:8888
    networks:
      - mynet
    restart: always

networks:
  mynet:
    external:
      name: mynet
3.2再创建flarum.env
DEBUG=false
FORUM_URL=http://192.168.1.105:8081

# Database configuration
DB_HOST=mariadb
DB_NAME=flarum
DB_USER=flarum
DB_PASS=123456789
DB_PREF=flarum_
DB_PORT=3306

# User admin flarum (environment variable for first installation)
# /!\ admin password must contain at least 8 characters /!\
FLARUM_ADMIN_USER=admin
FLARUM_ADMIN_PASS=123456789
FLARUM_ADMIN_MAIL=txt1994s@163.com
FLARUM_TITLE=txt1994的论坛

登录adminer,然后创建数据库

DB_HOST=mariadb (地址)
DB_NAME=flarum  (数据库)
DB_USER=flarum  (用户)
DB_PASS=123456789(密码)

然后运行命令:

docker-compose up -d flarum

安装中文插件

=Beta 14

docker exec -ti flarum extension require ffans/lang-simplified-chinese

安装emoji表情插件 docker exec -ti flarum extension require clarkwinkelmann/flarum-ext-emojionearea

安装显示帖子阅读次数 docker exec -ti flarum extension require michaelbelgium/flarum-discussion-views

安装flarum媒体增强插件 docker exec -ti flarum extension require fof/formatting

表格支持插件

docker exec -ti flarum extension require askvortsov/flarum-markdown-tables

代码高亮

docker exec -ti flarum extension require therealsujitk/flarum-ext-hljs

4.gitea创建参考

container_name: gitea
    volumes:
      - /srv/dev-disk-by-id-ata-VBOX_HARDDISK_VBdf1e9e6f-f90961e1-part1/gitea/data:/data
    ports:
      - "3000:3000"
      - "2222:22"
    networks:
      - mynet
    restart: always

networks:
  mynet:
    external:
      name: mynet

创建数据库:
      - MYSQL_ROOT_PASSWORD=1
      - MYSQL_DATABASE=gitea
      - MYSQL_USER=gitea
      - MYSQL_PASSWORD=123456789

5.wordpress创建参考

container_name: wordpress
    volumes:
      - /srv/dev-disk-by-id-ata-VBOX_HARDDISK_VBdf1e9e6f-f90961e1-part1/wordpress/html:/var/www/html
    ports:
      - 8082:80
    environment:
      WORDPRESS_DB_HOST: mariadb
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: 123456789
      WORDPRESS_DB_NAME: wordpress
    networks:
      - mynet
    restart: always

networks:
  mynet:
    external:
      name: mynet
   创建好数据库:
      WORDPRESS_DB_HOST: mariadb
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: 123456789
      WORDPRESS_DB_NAME: wordpress

6.nextcloud创建参考

container_name: nextcloud
    volumes:
      - /srv/dev-disk-by-id-ata-VBOX_HARDDISK_VBdf1e9e6f-f90961e1-part1/nextcloud/html:/var/www/html
    ports:
      - 8083:80   
    networks:
      - mynet    
    restart: always
    
创建好数据库:
environment:
      - MYSQL_PASSWORD=123456789
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=mariadb
Licensed under CC BY-NC-SA 4.0