Răsfoiți Sursa

add dockercompose

lushdog@outlook.com 4 săptămâni în urmă
părinte
comite
d79965bc90
3 a modificat fișierele cu 34 adăugiri și 1 ștergeri
  1. 1 1
      .gitignore
  2. 29 0
      docker-compose.yml
  3. 4 0
      env.example

+ 1 - 1
.gitignore

@@ -31,7 +31,7 @@ yarn-error.log*
 .pnpm-debug.log*
 
 # env files (can opt-in for committing if needed)
-.env.local
+.env*
 !.env.example
 
 # vercel

+ 29 - 0
docker-compose.yml

@@ -0,0 +1,29 @@
+version: '3.8'
+
+services:
+  byreal-table:
+    build:
+      context: .
+      dockerfile: Dockerfile
+      args:
+        # 构建参数(非敏感数据)
+        SOL_ENDPOINT: ${SOL_ENDPOINT:-}
+    container_name: byreal-table
+    ports:
+      - '80:3000'
+    environment:
+      # 运行时环境变量(从 .env 文件读取)
+      - SOL_ENDPOINT=${SOL_ENDPOINT}
+      - SOL_SECRET_KEY=${SOL_SECRET_KEY}
+      - NODE_ENV=production
+      - NEXT_TELEMETRY_DISABLED=1
+    restart: unless-stopped
+    # 如果需要持久化数据,可以取消注释以下配置
+    # volumes:
+    #   - ./data:/app/data
+    networks:
+      - byreal-network
+
+networks:
+  byreal-network:
+    driver: bridge

+ 4 - 0
env.example

@@ -3,3 +3,7 @@
 # 注意:.env.local 文件不会被提交到 Git
 SOL_ENDPOINT=
 
+# Solana 私钥(用于签名交易,敏感信息,不要提交到 Git)
+# 使用 docker-compose 时,可以创建 .env 文件(与 docker-compose.yml 同级)
+SOL_SECRET_KEY=
+