Skip to content

Commit a415a19

Browse files
Openblocks-docsgitbook-bot
Openblocks-docs
authored andcommitted
GitBook: [lowcoder-org#83] edit "Self-hosting"
1 parent 89a91a1 commit a415a19

File tree

3 files changed

+56
-9
lines changed

3 files changed

+56
-9
lines changed
-1.15 KB
Loading

docs/.gitbook/assets/mongodb-uri.png

69.5 KB
Loading

docs/self-hosting/README.md

Lines changed: 56 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,69 @@ docker run -d --name openblocks -p 3000:3000 -v "$PWD/stacks:/openblocks-stacks"
5757
{% endtab %}
5858
{% endtabs %}
5959

60+
## Customize deployment configurations
61+
62+
This section shows how to customize deployment configurations. If you have already started a container, you need to restart the container for the new configurations to take effect. Following are the ways to **restart** your container:
63+
64+
{% tabs %}
65+
{% tab title="Docker-Compose (Recommend)" %}
66+
One single command:
67+
68+
```
69+
docker-compose up
70+
```
71+
72+
It picks up configuration changes by stopping containers already in service and recreating new ones.
73+
{% endtab %}
74+
75+
{% tab title="Docker" %}
76+
Run the following commands to stop, remove the container already in service, and start up a new one using the newly customized deployment command.
77+
78+
```docker
79+
docker stop openblocks
80+
docker rm openblocks
81+
# run your new docker run command
82+
```
83+
{% endtab %}
84+
{% endtabs %}
85+
86+
### Use your own MongoDB
87+
88+
By default Openblocks uses the built-in MongoDB installed inside the container, and you can replace it with your own MongoDB cluster.
89+
90+
{% tabs %}
91+
{% tab title="Docker-Compose" %}
92+
Add an environment variable `MONGODB_URI` in `docker-compose.yml` downloaded in your working directory.\
93+
<img src="../.gitbook/assets/mongodb-uri.png" alt="" data-size="original">
94+
{% endtab %}
95+
96+
{% tab title="Docker" %}
97+
Add an environment variable `MONGODB_URI` to the deployment command, as shown below:
98+
99+
{% code overflow="wrap" %}
100+
```docker
101+
docker run -d --name openblocks -e MONGODB_URI=YOUR_MONGO_URI -p 3000:3000 -v "$PWD/stacks:/openblocks-stacks openblocksdev/openblocks-ce
102+
```
103+
{% endcode %}
104+
{% endtab %}
105+
{% endtabs %}
106+
60107
### Run as non-root user
61108

62-
By default the supervisor will run under the user `uid=9001`. You can specify the uid by adding a docker environment variable `LOCAL_USER_ID` and setting its value.
109+
By default the supervisor will run under the user `uid=9001`. You can specify the uid by adding a docker environment variable `LOCAL_USER_ID` and setting its value to a **Number**, such as `10010`.
63110

64111
{% tabs %}
65112
{% tab title="Docker-Compose" %}
66113
Add an environment variable `LOCAL_USER_ID` in `docker-compose.yml` downloaded in your working directory.\
67-
<img src="../.gitbook/assets/local-user-id (1).png" alt="" data-size="original">
114+
<img src="../.gitbook/assets/local-user-id.png" alt="" data-size="original">
68115
{% endtab %}
69116

70117
{% tab title="Docker" %}
71-
Add an environment variable `LOCAL_USER_ID` to the deploying command, as shown below:
118+
Add an environment variable `LOCAL_USER_ID` to the deployment command, as shown below:
72119

73120
{% code overflow="wrap" %}
74-
```bash
75-
docker run -d --name openblocks -e LOCAL_USER_ID = YOUR_USER_ID -p 3000:3000 -v "$PWD/stacks:/openblocks-stacks" openblocksdev/openblocks-ce
121+
```docker
122+
docker run -d --name openblocks -e LOCAL_USER_ID=10010 -p 3000:3000 -v "$PWD/stacks:/openblocks-stacks" openblocksdev/openblocks-ce
76123
```
77124
{% endcode %}
78125
{% endtab %}
@@ -91,10 +138,10 @@ With an SSL certificate, you can securely visit self-hosted Openblocks with HTTP
91138

92139
{% tab title="Docker" %}
93140
1. Copy `fullchain.pem` and `privkey.pem` to the `$PWD/stacks/ssl` directory.
94-
2. Change the `ports` of the deploying command to `3443:3443`, as shown below:
141+
2. Change the `ports` in the deployment command to `3443:3443`, as shown below:
95142

96143
{% code overflow="wrap" %}
97-
```bash
144+
```docker
98145
docker run -d --name openblocks -p 3443:3443 -v "$PWD/stacks:/openblocks-stacks" openblocksdev/openblocks-ce
99146
```
100147
{% endcode %}
@@ -113,7 +160,7 @@ In cases where you have certificates with names: `server.crt` and `server.key`,
113160
{% tab title="Docker-Compose" %}
114161
Run the following commands to update to the latest Openblocks image:
115162

116-
```bash
163+
```docker
117164
docker-compose pull
118165
docker-compose rm -fsv openblocks
119166
docker-compose up -d
@@ -124,7 +171,7 @@ docker-compose up -d
124171
Run the following commands to update to the latest Openblocks image:
125172

126173
{% code overflow="wrap" %}
127-
```bash
174+
```docker
128175
docker pull openblocksdev/openblocks-ce
129176
docker rm -fv openblocks
130177
docker run -d --name openblocks -p 3000:3000 -v "$PWD/stacks:/openblocks-stacks" openblocksdev/openblocks-ce

0 commit comments

Comments
 (0)