mirror of
https://github.com/labring/FastGPT.git
synced 2026-04-26 02:07:28 +08:00
cc3a91d009
* Opensandbox (#6651) * volumn manager * feat: opensandbox volumn * perf: action (#6654) * perf: action * doc * doc * deploy tml * update template
28 lines
904 B
Bash
28 lines
904 B
Bash
#!/bin/bash
|
|
|
|
# Set work directory from environment variable, default to /home/sandbox
|
|
WORKDIR="${FASTGPT_WORKDIR:-/home/sandbox}"
|
|
mkdir -p "${WORKDIR}"
|
|
|
|
# Capture the flag before unsetting, then clear all FastGPT runtime vars
|
|
_ENABLE_CODE_SERVER="${FASTGPT_ENABLE_CODE_SERVER}"
|
|
unset FASTGPT_SESSION_ID FASTGPT_WORKDIR FASTGPT_ENABLE_CODE_SERVER
|
|
|
|
# Start code-server or sleep forever
|
|
if [ "${_ENABLE_CODE_SERVER}" = "true" ]; then
|
|
# --bind-addr 0.0.0.0:8080 allows access from outside the container
|
|
# --auth none removes password protection
|
|
exec code-server \
|
|
--bind-addr 0.0.0.0:8080 \
|
|
--auth none \
|
|
--disable-telemetry \
|
|
--disable-update-check \
|
|
--disable-workspace-trust \
|
|
--disable-getting-started-override \
|
|
--app-name "Skills" \
|
|
--user-data-dir /home/sandbox/.local/share/code-server \
|
|
"${WORKDIR}"
|
|
else
|
|
exec sleep infinity
|
|
fi
|