diff --git a/config.js b/config.js new file mode 100644 index 0000000..dc40940 --- /dev/null +++ b/config.js @@ -0,0 +1,25 @@ +// ============================================================ +// ⚙️ Forumlify 配置文件 +// 自托管版本 +// ============================================================ + +const CONFIG = { + // ===== 必填 ===== + + // 后端 API 地址 + // - Docker 部署:http://backend:3000/api + // - 本地开发:http://localhost:3000/api + // - 生产环境:https://你的域名/api + API_BASE_URL: 'http://localhost:3000/api', + + // ===== 可选 ===== + + // 论坛名称(显示在左上角) + FORUM_NAME: 'Forumlify', + + // 是否开启发帖/注册的人机验证(10以内加减法) + ENABLE_CAPTCHA: true, +}; + +// ===== 不要修改下面 ===== +if (typeof module !== 'undefined' && module.exports) module.exports = CONFIG; \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..fc8727b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,27 @@ +version: '3' +services: + db: + image: postgres:15 + environment: + POSTGRES_USER: forumlify + POSTGRES_PASSWORD: 123456 + POSTGRES_DB: forumlify + volumes: + - ./schema.sql:/docker-entrypoint-initdb.d/schema.sql + - db_data:/var/lib/postgresql/data + ports: + - "5432:5432" + + app: + build: . + ports: + - "3000:3000" + depends_on: + - db + environment: + DATABASE_URL: postgresql://forumlify:123456@db:5432/forumlify + volumes: + - ./uploads:/app/uploads + +volumes: + db_data: \ No newline at end of file diff --git a/dockerfile.dockerfile b/dockerfile.dockerfile new file mode 100644 index 0000000..60ceb39 --- /dev/null +++ b/dockerfile.dockerfile @@ -0,0 +1,7 @@ +FROM node:18-alpine +WORKDIR /app +COPY package*.json ./ +RUN npm install +COPY . . +EXPOSE 3000 +CMD ["npm", "start"] \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..3a4da3b --- /dev/null +++ b/index.html @@ -0,0 +1,1448 @@ + + +
+ + +