Skip to content

Commit fb69245

Browse files
committed
chore: 🤖 更新dockefile
1 parent 546bea4 commit fb69245

File tree

2 files changed

+60
-10
lines changed

2 files changed

+60
-10
lines changed

README.md

Lines changed: 58 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Clone processon
1+
# [clone processon](https://github.com/maqi1520/clone-processon)
22

33
NodeJS 版在线流程图,模仿 https://www.processon.com/
44

@@ -14,12 +14,61 @@ NodeJS 版在线流程图,模仿 https://www.processon.com/
1414

1515
## 部署
1616

17-
- 没有装 postgresql 可以使用 `docker-compose.yml` 启一个容器服务
18-
17+
安装 docker docker-compose
18+
19+
```yml
20+
# Use postgres/example user/password credentials
21+
version: "3.8"
22+
23+
services:
24+
db:
25+
image: postgres
26+
volumes:
27+
- pg_data:/var/lib/postgresql/data
28+
restart: always
29+
ports:
30+
- 5432:5432
31+
environment:
32+
POSTGRES_DB: pro
33+
POSTGRES_USER: admin
34+
POSTGRES_PASSWORD: example
35+
36+
adminer:
37+
image: adminer
38+
restart: always
39+
ports:
40+
- 8080:8080
41+
42+
app:
43+
image: maqi1520/cloneprocesson
44+
ports:
45+
- "3000:3000"
46+
environment:
47+
DATABASE_URL: "postgresql://admin:example@db:5432/pro?schema=public"
48+
JWT_SECRET: "xxxx"
49+
GITHUB_CLIENT_ID: "xxxx"
50+
GITHUB_CLIENT_SECRET: "xxxx"
51+
DOMAIN: "http://localhost:3000"
52+
EMAIL_USER: "[email protected]"
53+
EMAIL_USER_NAME: "xxxxx"
54+
EMAIL_HOST: "smtp.163.com"
55+
EMAIL_PASS: "xxxx"
56+
depends_on:
57+
- db
58+
volumes:
59+
pg_data:
1960
```
61+
62+
启动
63+
64+
```bash
2065
docker-compose up -d
2166
```
2267

68+
## 本地开发
69+
70+
- 安装 nodejs 环境
71+
- 安装 yarn
2372
- 复制 .env.example 命名为 .env
2473

2574
```
@@ -46,14 +95,18 @@ GITHUB_CLIENT_ID="xxxxxxxxxx"
4695
GITHUB_CLIENT_SECRET="xxxxxxxxx"
4796
```
4897

49-
## 本地开发
50-
5198
- 安装依赖
5299

53100
```
54101
yarn install
55102
```
56103

104+
- 初始化数据
105+
106+
```
107+
npx prisma db seed
108+
```
109+
57110
- 打包
58111

59112
```

dockerfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
# 使用轻量级 Node.js 镜像
2-
FROM node:18-alpine
3-
4-
# 使用 apk 包管理器来安装 openssl
5-
RUN apk update && apk add --no-cache openssl
1+
# 使用 Node.js 镜像
2+
FROM node:18
63

74
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
85

0 commit comments

Comments
 (0)