Here123 commited on
Commit
5205fd3
1 Parent(s): 9d7c8ed

Create main.py

Browse files
Files changed (1) hide show
  1. main.py +12 -0
main.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import subprocess
2
+
3
+ # 拉取Docker镜像
4
+ subprocess.run(["docker", "pull", "yidadaa/chatgpt-next-web"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
5
+
6
+ # 运行Docker容器
7
+ subprocess.run([
8
+ "docker", "run", "-d", "-p", "3000:3000",
9
+ "-e", "OPENAI_API_KEY=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",
10
+ "-e", "CODE=123456",
11
+ "yidadaa/chatgpt-next-web"
12
+ ], stdout=subprocess.PIPE, stderr=subprocess.PIPE)