File size: 423 Bytes
5205fd3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import subprocess
# 拉取Docker镜像
subprocess.run(["docker", "pull", "yidadaa/chatgpt-next-web"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
# 运行Docker容器
subprocess.run([
"docker", "run", "-d", "-p", "3000:3000",
"-e", "OPENAI_API_KEY=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",
"-e", "CODE=123456",
"yidadaa/chatgpt-next-web"
], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|