Skip to content

Commit e3fde2d

Browse files
committed
not finish
0 parents  commit e3fde2d

File tree

4 files changed

+80
-0
lines changed

4 files changed

+80
-0
lines changed

.ENV.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NODEBB_URL=http://127.0.0.1

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM node:18-bullseye-slim
2+
COPY init_nodebb.py /
3+
4+
RUN apt update && \
5+
apt install git python3 -y
6+
RUN cd / && git clone "https://github.com/NodeBB/NodeBB.git"
7+
RUN cd /NodeBB && git checkout v1.19.7
8+
9+
WORKDIR /NodeBB
10+
RUN cp install/package.json . && npm install
11+
12+
CMD python3 /init_nodebb.py && ./nodebb dev

docker-compose.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
version: "3.0"
2+
services:
3+
nodebb:
4+
build: .
5+
ports:
6+
- "4567:4567"
7+
volumes:
8+
- .modules:/modules
9+
- uploads:/uploads
10+
environment:
11+
DB_USER: ${DB_USER-root}
12+
DB_PASSWORD: ${BD_PASSWORD-rewtfdgg}
13+
URL: ${NODEBB_URL-http://127.0.0.1}
14+
links:
15+
- mongo
16+
depends_on:
17+
- mongo
18+
19+
mongo:
20+
image: mongo
21+
restart: always
22+
environment:
23+
MONGO_INITDB_ROOT_USERNAME: ${DB_USER-root}
24+
MONGO_INITDB_ROOT_PASSWORD: ${BD_PASSWORD-rewtfdgg}
25+
volumes:
26+
- mongo_data:/data/db
27+
28+
mongo-express:
29+
image: mongo-express
30+
restart: always
31+
ports:
32+
- "8081:8081"
33+
environment:
34+
ME_CONFIG_BASICAUTH_USERNAME: ${ME_USER-root}
35+
ME_CONFIG_BASICAUTH_PASSWORD: ${ME_PASSWORD-rewtfdgg}
36+
ME_CONFIG_MONGODB_URL: mongodb://${DB_USER-root}:${DB_PASSWORD-rewtfdgg}@mongo:27017/
37+
links:
38+
- mongo
39+
depends_on:
40+
- mongo
41+
42+
volumes:
43+
mongo_data:
44+
uploads:

init_nodebb.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import os
2+
import json
3+
import uuid
4+
5+
secret = uuid.uuid1()
6+
config = {
7+
"url": os.environ.get("URL",None),
8+
"secret": str(secret),
9+
"database": "mongo",
10+
"port": "4567",
11+
"bind_address":"0.0.0.0",
12+
"mongo": {
13+
"host": "mongo",
14+
"port": "27017",
15+
"username": os.environ.get("DB_USER",None),
16+
"password": os.environ.get("DB_PASSWORD",None),
17+
"database": "admin",
18+
"uri": ""
19+
}
20+
}
21+
22+
with open("/NodeBB/config.json","w") as f:
23+
json.dump(config,f)

0 commit comments

Comments
 (0)