Skip to content

Commit

Permalink
Using dynamic env launcher instead of pre build image (#33)
Browse files Browse the repository at this point in the history
* feat: using fork official image, no self build

* feat: dockernized without pre build

* docs: remove make image section

* feat: use docker hub image with dynmaic env launcher
  • Loading branch information
alswl authored Nov 11, 2023
1 parent 310944b commit 090283e
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 178 deletions.
9 changes: 0 additions & 9 deletions .gitmodules

This file was deleted.

106 changes: 0 additions & 106 deletions Makefile

This file was deleted.

53 changes: 31 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,17 @@ Related docs:
- [私有化在线协同画图平台 Excalidraw | Log4D]( https://blog.alswl.com/2022/10/self-hosted-excalidraw/ )


## Build and Run
## Deploy

Clone, patch, and build:
Clone, and run:

```
git clone --recursive [email protected]:alswl/excalidraw-collaboration.git
git clone [email protected]:alswl/excalidraw-collaboration.git
cd excalidraw-collaboration
git config submodule.excalidraw.ignore all # ignore submodule changes, we will patch them
# $EDITOR excalidraw.env.production # (optional) edit service endpoint
make patch images # patch to configurations and build the container image
make update-docker-compose-version # update images version for docker-compose
docker-compose up # run the containers
open "http://localhost" # open browser, and you can using the Team work functions
```

Bump version:

excalidraw-collaboration always follow the excalidraw version, so you can only bump the appendix version.

```
# make sure all changes are commited
make images # build new image without dirty
make bump-version # bump version if your configuration changes(the changes will build into
git commit -a -m 'feat: bump with my local config' # save your changes
open "http://localhost" # open browser, and you can using the collbration functions
```

Browse it:
Expand All @@ -59,5 +42,31 @@ Browse it:
About public network release:

if you want to release your own excalidraw in public network,
you should modify the `excalidraw.env.production` file,
you should modify the `docker-compose.yaml` file,
Replace the `REACT_APP_HTTP_STORAGE_BACKEND_URL` and `REACT_APP_WS_SERVER_URL` with your own domain.

## Q & A

### How to deploy on the cloud(aws etc)

The `docker-compose.yaml` file is for local deploy, if you want to deploy on the cloud,
you should prepare 2 Load Balancer(with HTTPS cert), one for websocket server, one for storage server.

The `REACT_APP_HTTP_STORAGE_BACKEND_URL` is for the Load Balancer URL(HTTPS) for storage,
and the `REACT_APP_WS_SERVER_URL` is for the Load Balancer URL(HTTPS) for websocket.

Here is a conversation about how to deploy on the aws: https://github.com/alswl/excalidraw-collaboration/issues/22

### generateKey problem

Error message:

```
TypeError: Cannot read properties of undefined (reading 'generateKey')
```

Why: The excalidraw is using crypto module of Javascript, the HTTPS is required.

How to solve: use HTTPS to access the page, or use http://localhost instead.


3 changes: 0 additions & 3 deletions UPSTREAM_VERSION

This file was deleted.

16 changes: 13 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,29 @@

services:
frontend:
image: excalidraw:v0.1.0-94d3682
image: alswl/excalidraw:v0.15.0-fork-b3
environment:
- PORT=8081
- REACT_APP_BACKEND_V2_GET_URL=https://test.com/api/v2/
- REACT_APP_BACKEND_V2_POST_URL=https://test.com/api/v2/post/
- REACT_APP_WS_SERVER_URL=http://127.0.0.1:8082
- REACT_APP_FIREBASE_CONFIG={}
# alswl'fork env
# forked excalidraw can use env https://github.com/alswl/excalidraw/pull/5
- REACT_APP_HTTP_STORAGE_BACKEND_URL=http://127.0.0.1:8081/api/v2
- REACT_APP_STORAGE_BACKEND=http
ports:
- 80:80

storage:
image: excalidraw-storage-backend:v0.1.0-94d3682
image: alswl/excalidraw-storage-backend:v2023.11.11
restart: always
environment: # docs https://github.com/alswl/excalidraw-storage-backend#environement-variables
- PORT=8081
ports:
- 8081:8081

room:
image: excalidraw-room:v0.1.0-94d3682
image: excalidraw/excalidraw-room:sha-49bf529
ports:
- 8082:80
1 change: 0 additions & 1 deletion excalidraw
Submodule excalidraw deleted from bf5cf8
1 change: 0 additions & 1 deletion excalidraw-room
Submodule excalidraw-room deleted from c0bf0b
1 change: 0 additions & 1 deletion excalidraw-storage-backend
Submodule excalidraw-storage-backend deleted from e32193
11 changes: 0 additions & 11 deletions excalidraw.dockerignore

This file was deleted.

21 changes: 0 additions & 21 deletions excalidraw.env.production

This file was deleted.

0 comments on commit 090283e

Please sign in to comment.