Skip to content

Commit e747eb2

Browse files
authored
Merge pull request #112 from CyberL1/feat/docker-setup-page
2 parents 4c61562 + 1d38e55 commit e747eb2

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

docs/setup/server/docker.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Running the server as a docker container
2+
3+
## Bundle
4+
5+
1. Add an isolated network to share between the server and the database:
6+
```sh
7+
docker network create spacebar-network
8+
```
9+
10+
2. Set up a database for the server:
11+
```sh
12+
docker run \
13+
-d \
14+
--name spacebar-db \
15+
--network spacebar-network \
16+
-e POSTGRES_PASSWORD=postgres \
17+
postgres:alpine
18+
```
19+
20+
3. Run the server docker image to let it generate the config:
21+
```sh
22+
docker run \
23+
--rm \
24+
--name spacebar-server \
25+
--network spacebar-network \
26+
-e DATABASE=postgres://postgres:postgres@spacebar-db/postgres \
27+
-e CONFIG_PATH=config/config.json \
28+
-v ./config:/config \
29+
-v ./files:/files \
30+
ghcr.io/{{ repositories.server }}
31+
```
32+
33+
4. Set config values for `general_serverName`, `cdn_endpointPublic`, `cdn_endpointPrivate` to `http://localhost:3001`, `api_endpointPublic` to `http://localhost:3001/api/v9` and `gateway_endpointPublic` to `ws://localhost:3001`
34+
35+
5. Run the server docker image after the config changes:
36+
```sh
37+
docker run \
38+
--name spacebar-server \
39+
--network spacebar-network \
40+
-e DATABASE=postgres://postgres:postgres@spacebar-db/postgres \
41+
-e CONFIG_PATH=config/config.json \
42+
-v ./config:/config \
43+
-v ./files:/files \
44+
-p 3001:3001 \
45+
ghcr.io/{{ repositories.server }}
46+
```

0 commit comments

Comments
 (0)