Skip to content

Commit 61ec215

Browse files
committed
chore: 调整自动化部署的配置项
1 parent 0c7333f commit 61ec215

File tree

4 files changed

+73
-9
lines changed

4 files changed

+73
-9
lines changed

Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM node:lts-alpine
2+
3+
# Working directory
4+
WORKDIR /app
5+
6+
# Install dependencies
7+
RUN npm install -g pnpm
8+
COPY package.json pnpm-lock.yaml ./
9+
RUN pnpm install
10+
11+
# Install plugins and sdk dependency
12+
COPY ./pnpm-workspace.yaml ./
13+
COPY ./plugins ./plugins
14+
RUN pnpm install
15+
16+
# Copy source
17+
COPY . .
18+
RUN pnpm install
19+
20+
# Build and cleanup
21+
ENV NODE_ENV=production
22+
23+
# Install plugins(whitelist)
24+
RUN cd plugins/com.msgbyte.docs && npm run build:web && cd -
25+
26+
# Start server
27+
CMD ["pnpm", "serve"]

docker-compose.env

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
################ tailchat-docs ################
2+
3+
# Same with tailchat-server
4+
5+
NAMESPACE=
6+
LOGGER=true
7+
LOGLEVEL=info
8+
SERVICEDIR=services
9+
10+
TRANSPORTER=redis://redis:6379
11+
12+
CACHER=redis://redis:6379
13+
14+
REDIS_URL=redis://redis:6379
15+
MONGO_URL=mongodb://mongo/tailchat
16+
SECRET=
17+
18+
# file
19+
API_URL=https://paw-server-test.moonrailgun.com
20+
21+
# minio
22+
MINIO_URL=minio:9000
23+
MINIO_USER=tailchat
24+
MINIO_PASS=com.msgbyte.tailchat
25+
26+
# SMTP
27+
SMTP_SENDER=
28+
SMTP_URI=
29+
30+
################ etherpad ################
31+
132
REQUIRE_AUTHENTICATION=true
233
PAD_OPTIONS_SHOW_LINE_NUMBERS=false
334
DEFAULT_PAD_TEXT="欢迎使用 Tailchat 云文档。\n官网: https://tailchat.msgbyte.com\n"

docker-compose.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,29 @@
33
version: "3.3"
44

55
services:
6-
tailchat-docs-web:
7-
image: nginx
6+
# Tailchat 云文档
7+
tailchat-docs:
8+
build:
9+
context: .
10+
image: tailchat-docs
11+
env_file: docker-compose.env
12+
depends_on:
13+
- mongo
14+
- redis
815
labels:
916
- "traefik.enable=true"
1017
- "traefik.http.routers.tailchat-docs-web.rule=PathPrefix(`/tc-docs-web/`)"
11-
- "traefik.http.services.tailchat-docs-web.loadbalancer.server.port=80"
12-
volumes:
13-
- ./public:/usr/share/nginx/html/tc-docs-web
18+
- "traefik.http.services.tailchat-docs-web.loadbalancer.server.port=22010"
1419
networks:
1520
- tailchat
1621

17-
tailchat-etherpad:
22+
tailchat-docs-etherpad:
1823
build:
1924
context: ./etherpad-lite
2025
env_file:
2126
- "docker-compose.env"
2227
- ".ep.env"
23-
image: tailchat-etherpad
28+
image: tailchat-docs-etherpad
2429
environment:
2530
DB_TYPE: mongodb
2631
DB_URL: mongodb://mongo:27017/tailchat_ep

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
"author": "moonrailgun",
44
"private": true,
55
"scripts": {
6-
"dev": "concurrently --handle-input npm:dev:service npm:dev:web npm:dev:web:http",
6+
"dev": "concurrently --handle-input npm:dev:service npm:dev:web npm:serve:web:http",
77
"dev:service": "ts-node ./runner.ts",
88
"dev:web": "cd plugins/com.msgbyte.docs && npm run build:web:watch",
9-
"dev:web:http": "http-server -c-1 -p 22010 ./public",
9+
"serve": "concurrently npm:dev:service npm:serve:web:http",
10+
"serve:web:http": "http-server -c-1 -p 22010 ./public",
1011
"postinstall": "git submodule init && git submodule update"
1112
},
1213
"dependencies": {

0 commit comments

Comments
 (0)