wwforonce commited on
Commit
334d2a0
·
1 Parent(s): d0db6de

fix user path

Browse files
Files changed (2) hide show
  1. Dockerfile +14 -9
  2. start_with_sync.sh +9 -9
Dockerfile CHANGED
@@ -64,19 +64,24 @@ ENV DATA_DIR=/tmp/open-webui-data
64
  ENV STATIC_DIR=/tmp/static
65
 
66
  # Copy sync scripts
67
- COPY sync_storage.py /app/sync_storage.py
68
- COPY start_with_sync.sh /start.sh
 
 
 
69
 
70
- # Make scripts executable
71
- RUN chmod +x /app/sync_storage.py /start.sh
72
 
73
  # Set working directory
74
  # WORKDIR /app
75
 
76
- COPY ./add_bash_util.sh /add_bash_util.sh
77
- COPY ./Caddyfile /Caddyfile
78
- COPY ./crypt.sh /crypt.sh
79
- COPY ./gemini /gemini
 
 
 
 
80
  # Expose ports
81
 
82
  EXPOSE 7860
@@ -88,4 +93,4 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s \
88
 
89
 
90
  # Start with sync
91
- ENTRYPOINT ["/start.sh"]
 
64
  ENV STATIC_DIR=/tmp/static
65
 
66
  # Copy sync scripts
67
+ COPY sync_storage.py ${HOME}/sync_storage.py
68
+ COPY start_with_sync.sh ${HOME}/start_with_sync.sh
69
+
70
+
71
+ ENV SYNC_STORAGE=${HOME}/sync_storage.py
72
 
 
 
73
 
74
  # Set working directory
75
  # WORKDIR /app
76
 
77
+ COPY ./add_bash_util.sh ${HOME}/add_bash_util.sh
78
+ COPY ./Caddyfile ${HOME}/Caddyfile
79
+ COPY ./crypt.sh ${HOME}/crypt.sh
80
+ COPY ./gemini ${HOME}/gemini
81
+
82
+ # Make scripts executable
83
+ RUN chmod +x ${HOME}/*.py ${HOME}/*.sh
84
+
85
  # Expose ports
86
 
87
  EXPOSE 7860
 
93
 
94
 
95
  # Start with sync
96
+ ENTRYPOINT ["/home/appuser/start_with_sync.sh"]
start_with_sync.sh CHANGED
@@ -57,7 +57,7 @@ fi
57
 
58
  # Download existing data on startup
59
  echo "Syncing data from Hugging Face..."
60
- python3 /app/sync_storage.py download
61
 
62
  # Function to handle graceful shutdown
63
  cleanup() {
@@ -66,7 +66,7 @@ cleanup() {
66
  # Upload final data state
67
  if [ -n "$HF_TOKEN" ]; then
68
  echo "Uploading final data state..."
69
- python3 /app/sync_storage.py upload
70
  fi
71
 
72
  # Kill background processes
@@ -85,7 +85,7 @@ background_sync() {
85
  while true; do
86
  sleep $SYNC_INTERVAL
87
  echo "Periodic sync to Hugging Face..."
88
- python3 /app/sync_storage.py upload
89
  done
90
  else
91
  echo "Skipping background sync - no HF_TOKEN"
@@ -112,7 +112,7 @@ WEBUI_PID=$!
112
  # Wait for Open WebUI process
113
  # wait $WEBUI_PID
114
 
115
- source /add_bash_util.sh
116
  . "$NVM_DIR/nvm.sh"
117
 
118
  gh_install caddyserver/caddy linux_amd64.tar.gz /tmp/caddy.tar.gz
@@ -265,10 +265,10 @@ EOF
265
 
266
 
267
 
268
- /crypt.sh decrypt /gemini/enc.dev.var.x -e GEMINI_AUTH_ENC_PASS -o /tmp/gemini-cli-openai/.dev.var.x
269
- /crypt.sh decrypt /gemini/enc.dev.var.j -e GEMINI_AUTH_ENC_PASS -o /tmp/gemini-cli-openai/.dev.var.j
270
- /crypt.sh decrypt /gemini/enc.dev.var.w -e GEMINI_AUTH_ENC_PASS -o /tmp/gemini-cli-openai/.dev.var.w
271
- /crypt.sh decrypt /gemini/enc.dev.var.l -e GEMINI_AUTH_ENC_PASS -o /tmp/gemini-cli-openai/.dev.var.l
272
 
273
 
274
 
@@ -278,7 +278,7 @@ cd /tmp/gemini-cli-openai && npm i && npx wrangler dev --port 8881 --host 0.0.0.
278
  # cd /tmp/gemini-cli-openai && npm i && npx wrangler dev --port 8882 --host 0.0.0.0 --env j &
279
  # cd /tmp/gemini-cli-openai && npm i && npx wrangler dev --port 8883 --host 0.0.0.0 --env w &
280
  # cd /tmp/gemini-cli-openai && npm i && npx wrangler dev --port 8884 --host 0.0.0.0 --env l &
281
- /tmp/caddy/caddy run --config /Caddyfile &
282
  MAIN_PID=$!
283
 
284
  # Wait for caddy process
 
57
 
58
  # Download existing data on startup
59
  echo "Syncing data from Hugging Face..."
60
+ python3 ${HOME}/sync_storage.py download
61
 
62
  # Function to handle graceful shutdown
63
  cleanup() {
 
66
  # Upload final data state
67
  if [ -n "$HF_TOKEN" ]; then
68
  echo "Uploading final data state..."
69
+ python3 ${HOME}/sync_storage.py upload
70
  fi
71
 
72
  # Kill background processes
 
85
  while true; do
86
  sleep $SYNC_INTERVAL
87
  echo "Periodic sync to Hugging Face..."
88
+ python3 ${HOME}/sync_storage.py upload
89
  done
90
  else
91
  echo "Skipping background sync - no HF_TOKEN"
 
112
  # Wait for Open WebUI process
113
  # wait $WEBUI_PID
114
 
115
+ source ${HOME}/add_bash_util.sh
116
  . "$NVM_DIR/nvm.sh"
117
 
118
  gh_install caddyserver/caddy linux_amd64.tar.gz /tmp/caddy.tar.gz
 
265
 
266
 
267
 
268
+ ${HOME}/crypt.sh decrypt ${HOME}/gemini/enc.dev.var.x -e GEMINI_AUTH_ENC_PASS -o /tmp/gemini-cli-openai/.dev.var.x
269
+ ${HOME}/crypt.sh decrypt ${HOME}/gemini/enc.dev.var.j -e GEMINI_AUTH_ENC_PASS -o /tmp/gemini-cli-openai/.dev.var.j
270
+ ${HOME}/crypt.sh decrypt ${HOME}/gemini/enc.dev.var.w -e GEMINI_AUTH_ENC_PASS -o /tmp/gemini-cli-openai/.dev.var.w
271
+ ${HOME}/crypt.sh decrypt ${HOME}/gemini/enc.dev.var.l -e GEMINI_AUTH_ENC_PASS -o /tmp/gemini-cli-openai/.dev.var.l
272
 
273
 
274
 
 
278
  # cd /tmp/gemini-cli-openai && npm i && npx wrangler dev --port 8882 --host 0.0.0.0 --env j &
279
  # cd /tmp/gemini-cli-openai && npm i && npx wrangler dev --port 8883 --host 0.0.0.0 --env w &
280
  # cd /tmp/gemini-cli-openai && npm i && npx wrangler dev --port 8884 --host 0.0.0.0 --env l &
281
+ /tmp/caddy/caddy run --config ${HOME}/Caddyfile &
282
  MAIN_PID=$!
283
 
284
  # Wait for caddy process