Create main.py
Browse files
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)
|