NocoBase搭建(下):安装NocoBase

发布于:2024-12-18 ⋅ 阅读:(82) ⋅ 点赞:(0)

系统和Docker安装好后,开始安装NocoBase。
一.创建文件夹NocoBase
root@Nocobase:/mkdir NocoBase && cd NocoBase

二.创建 docker-compose.yml
root@Nocobase:/vi docker-compose.yml
version: "3"

networks:
  nocobase:
    driver: bridge

services:
  app:
    image: nocobase/nocobase:latest
    networks:
      - nocobase
    depends_on:
      - postgres
    environment:
      # The application's secret key, used to generate user tokens, etc.
      # If APP_KEY is changed, old tokens will also become invalid.
      # It can be any random string, and make sure it is not exposed.应用程序密码
      - APP_KEY=Wodenocobase
      # Database type, supports postgres, mysql, mariadb数据库类型
      - DB_DIALECT=postgres
      # Database host, can be replaced with the IP of an existing database server数据库服务器地址
      - DB_HOST=postgres
      # Database name
      - DB_DATABASE=nocobase
      # Database user
      - DB_USER=nocobase
      # Database password数据库密码
      - DB_PASSWORD=Wodenocobase
      # Timezone
      - TZ=Asia/Shanghai
    volumes:
      - ./storage:/usr/nocobase/storage
    ports:
      - "13000:80"
    # init: true

  # If using an existing database server, postgres service can be omitted
  postgres:
    image: postgres:16
    restart: always
    command: postgres -c wal_level=logical
    environment:
      POSTGRES_USER: nocobase
      POSTGRES_DB: nocobase
      POSTGRES_PASSWORD: Wodenocobase
    volumes:
      - ./storage/db/postgres:/var/lib/postgresql/data
    networks:
      - nocobase

三.安装docker-compose
root@Nocobase:/usr/NocoBase# docker-compose pull
-bash: docker-compose: command not found
root@Nocobase:/usr/NocoBase# docker-compose -version
-bash: docker-compose: command not found
需要安装docker-compose
root@Nocobase:/usr/NocoBase# apt install docker-compose
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done

四.安装启动NocoBase
安装docker-compose 后终于可以正常拉起Docker了。
root@Nocobase:/usr/NocoBase# docker-compose pull
Pulling postgres ... done
Pulling app      ... done
root@Nocobase:/usr/NocoBase# docker-compose up -d
Creating network "nocobase_nocobase" with driver "bridge"
Creating nocobase_postgres_1 ... done
Creating nocobase_app_1      ... done
root@Nocobase:/usr/NocoBase# docker-compose logs app
Attaching to nocobase_app_1
app_1       | copying...
app_1       | yarn run v1.22.19
app_1       | $ nocobase create-nginx-conf
app_1       | Done in 0.62s.
app_1       | nginx started
app_1       | yarn run v1.22.19
app_1       | $ nocobase start --quickstart
app_1       | 2024-11-17T09:22:08: PM2 log: Launching in no daemon mode
app_1       | 2024-11-17T09:22:08: PM2 log: App [index:0] starting in -fork mode-
app_1       | 2024-11-17T09:22:08: PM2 log: App [index:0] online
root@Nocobase:/usr/NocoBase#

五.登录NocoBase
http://localhost:13000
admin@nocobase.com  admin123

六.搭建NocoBase应用
有很完整的开发例子:任务管理系统
熟悉UI Editor:界面,切换开发和运行状态,熟悉数据源和Collection的建立。通过Group,Page,Link构建你的菜单系统。在创建的Page上放置数据块(表格,表单,列表,图表。日历,甘特图等),一会儿就可以搭建出一个应用系统。

这才叫真正的低代码!
 


网站公告

今日签到

点亮在社区的每一天
去签到