fix: deploy

This commit is contained in:
Kilu 2024-06-29 00:06:09 +08:00
parent 37864a07ce
commit 7d55369dd8
5 changed files with 7 additions and 13 deletions

View File

@ -65,8 +65,10 @@ jobs:
SOURCE: "frontend/appflowy_web_app/dist frontend/appflowy_web_app/server.cjs frontend/appflowy_web_app/start.sh frontend/appflowy_web_app/Dockerfile frontend/appflowy_web_app/nginx.conf frontend/appflowy_web_app/.env nginx-signed.crt nginx-signed.key" SOURCE: "frontend/appflowy_web_app/dist frontend/appflowy_web_app/server.cjs frontend/appflowy_web_app/start.sh frontend/appflowy_web_app/Dockerfile frontend/appflowy_web_app/nginx.conf frontend/appflowy_web_app/.env nginx-signed.crt nginx-signed.key"
REMOTE_HOST: ${{ env.REMOTE_HOST }} REMOTE_HOST: ${{ env.REMOTE_HOST }}
REMOTE_USER: ${{ env.REMOTE_USER }} REMOTE_USER: ${{ env.REMOTE_USER }}
TARGET: /home/${{ env.REMOTE_USER }}/appflowy-web-app
EXCLUDE: "frontend/appflowy_web_app/dist/, frontend/appflowy_web_app/node_modules/" EXCLUDE: "frontend/appflowy_web_app/dist/, frontend/appflowy_web_app/node_modules/"
SCRIPT_AFTER: | SCRIPT_AFTER: |
cd appflowy-web-app
docker build -t appflowy-web-app . docker build -t appflowy-web-app .
docker rm -f appflowy-web-app || true docker rm -f appflowy-web-app || true
docker run -d -p 80:80 -p 443:443 --env-file .env --name appflowy-web-app appflowy-web-app docker run -d -p 3000:3000 --env-file .env --name appflowy-web-app appflowy-web-app

View File

@ -9,26 +9,17 @@ RUN bun install cheerio pino pino-pretty
COPY . . COPY . .
RUN addgroup --system nginx && \
adduser --system --no-create-home --disabled-login --ingroup nginx nginx
RUN apt-get clean && rm -rf /var/lib/apt/lists/* RUN apt-get clean && rm -rf /var/lib/apt/lists/*
COPY dist/ /usr/share/nginx/html/ COPY dist/ /usr/share/nginx/html/
COPY nginx.conf /etc/nginx/nginx.conf
COPY nginx-signed.crt /etc/ssl/certs/nginx-signed.crt
COPY nginx-signed.key /etc/ssl/private/nginx-signed.key
RUN chown -R nginx:nginx /etc/ssl/certs/nginx-signed.crt /etc/ssl/private/nginx-signed.key
COPY start.sh /app/start.sh COPY start.sh /app/start.sh
RUN chmod +x /app/start.sh RUN chmod +x /app/start.sh
EXPOSE 80 443 EXPOSE 3000
CMD ["/app/start.sh"] CMD ["/app/start.sh"]

View File

@ -38,7 +38,7 @@ http {
# Existing server block for HTTP # Existing server block for HTTP
server { server {
listen 80; listen 3000;
server_name localhost; server_name localhost;
#server_name appflowy.com *.appflowy.com; #server_name appflowy.com *.appflowy.com;

View File

@ -75,7 +75,6 @@ export function withYjs<T extends Editor>(
e.children = content.children; e.children = content.children;
console.log('initializeDocumentContent', doc.getMap(YjsEditorKey.data_section).toJSON(), e.children);
Editor.normalize(editor, { force: true }); Editor.normalize(editor, { force: true });
}; };

View File

@ -97,9 +97,11 @@ export function yDataToSlateContent({
export function yDocToSlateContent(doc: YDoc): Element | undefined { export function yDocToSlateContent(doc: YDoc): Element | undefined {
const sharedRoot = doc.getMap(YjsEditorKey.data_section) as YSharedRoot; const sharedRoot = doc.getMap(YjsEditorKey.data_section) as YSharedRoot;
if (!sharedRoot || sharedRoot.size === 0) return;
const document = sharedRoot.get(YjsEditorKey.document); const document = sharedRoot.get(YjsEditorKey.document);
const pageId = document.get(YjsEditorKey.page_id) as string; const pageId = document.get(YjsEditorKey.page_id) as string;
const blocks = document.get(YjsEditorKey.blocks) as YBlocks; const blocks = document.get(YjsEditorKey.blocks) as YBlocks;
const meta = document.get(YjsEditorKey.meta) as YMeta; const meta = document.get(YjsEditorKey.meta) as YMeta;
const childrenMap = meta.get(YjsEditorKey.children_map) as YChildrenMap; const childrenMap = meta.get(YjsEditorKey.children_map) as YChildrenMap;
const textMap = meta.get(YjsEditorKey.text_map) as YTextMap; const textMap = meta.get(YjsEditorKey.text_map) as YTextMap;