prime 是一款基于graphql的开源cms,功能点很不错,但是出来不久,还是有好多bug的
官方暂时没有提供docker 的运行方式,为了方便测试,搞了以及docker-compose 测试的
环境准备
- docker-copose 文件
version: "3"
services:
postgres:
image: postgres
ports:
- "5432:5432"
environment:
- "POSTGRES_DB=prime-sq"
- "POSTGRES_PASSWORD=dalong"
prime:
build: ./
ports:
- "4000:4000"
environment:
- "DATABASE_URL=postgresql://postgres:dalong@postgres:5432/prime-sq"
- "SESSION_SECRET=dalongdemo"
- prime dockerfile
很简单,就是copy 文件安装依赖以及启动
FROM node:9
WORKDIR /app
COPY . /app
RUN yarn
CMD [ "yarn","start" ]
- prime 代码
只是安装core 以及ui 就可以了,暂时是不需要编写代码的,就是package.json文件
{
"name": "prime-project",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"@primecms/core": "^0.2.2",
"@primecms/ui": "^0.2.2"
},
"scripts": {
"start":"primecms start"
}
}
启动&&测试
- 启动
docker-compose build && docker-compose up -d
- 设置界面
- 主界面
说明
当前bug还是比较多的,暂时可以尝鲜,后期应该会有优化改进
参考资料
https://birkir.github.io/prime/#/getstarted
https://github.com/rongfengliang/prime-docker-compose-running