refactor docker image build

This commit is contained in:
LeonOstrez
2025-03-06 17:12:03 +01:00
parent e7399a1945
commit aee37628bd
8 changed files with 158 additions and 210 deletions

28
cloud/entrypoint.sh Normal file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
export MONGO_DB_DATA=$PYTHAGORA_DATA_DIR/mongodata
mkdir -p $MONGO_DB_DATA
# Start MongoDB in the background
mongod --dbpath "$MONGO_DB_DATA" --bind_ip_all >> $MONGO_DB_DATA/mongo_logs.txt 2>&1 &
export DB_DIR=$PYTHAGORA_DATA_DIR/database
chown -R devuser: $PYTHAGORA_DATA_DIR
su -c "mkdir -p $DB_DIR" devuser
# Ensure code-server directories have correct permissions
chown -R devuser:devusergroup /usr/local/share/code-server
chmod -R 755 /usr/local/share/code-server
set -e
# Start the VS Code extension installer/HTTP server script in the background
su -c "cd /var/init_data/ && ./on-event-extension-install.sh &" devuser
# Set up git config
su -c "git config --global user.email 'devuser@pythagora.ai'" devuser
su -c "git config --global user.name 'pythagora'" devuser
# Keep container running
tail -f /dev/null