Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ services:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8082/health"]
interval: 10s
timeout: 10s
retries: 5
start_period: 30s
working_dir: /app/api
command:
./dev.sh
Expand Down Expand Up @@ -61,7 +65,7 @@ services:
networks:
- ezbids
tty: true #turn on color for bids-validator output
command: pm2 start handler.js --attach --watch --ignore-watch "ui **/node_modules"
command: pm2 start handler.js --attach --watch --ignore-watch "ui **/node_modules **__pycache__**"

ui:
container_name: brainlife_ezbids-ui
Expand All @@ -70,8 +74,16 @@ services:
environment:
VITE_APIHOST: http://${SERVER_NAME:-localhost}:8082
VITE_BRAINLIFE_AUTHENTICATION: ${BRAINLIFE_AUTHENTICATION:-false}
depends_on:
- api
- mongodb
- handler
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 10s
timeout: 10s
retries: 5
start_period: 30s
ports:
- 3000:3000 #vite wants to be exposed on the host for HMR?
networks:
Expand Down
2 changes: 1 addition & 1 deletion handler/handler.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions handler/handler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

const { spawn } = require('child_process');
import fs = require('fs');

Expand Down Expand Up @@ -40,7 +39,7 @@ function run() {
}
}
console.log("waiting a bit before looking for more jobs");
setTimeout(run, 1000*3);
setTimeout(run, 1000*1);
});
}

Expand Down
2 changes: 1 addition & 1 deletion handler/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# start server components
pm2 delete ezbids-handler
pm2 start handler.js --name ezbids-handler --watch --ignore-watch="*.log test *.sh ui bin example .git .syncthing*"
pm2 start handler.js --name ezbids-handler --watch --ignore-watch="*.log test *.sh ui bin example .git .syncthing* __pycache__"

pm2 delete ezbids-handler-tsc
pm2 start tsc.sh --name ezbids-handler-tsc
Expand Down
23 changes: 23 additions & 0 deletions launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,29 @@ else
mkdir -p ${EZBIDS_TMP_DIR}
fi

# Ensure proper permissions for Docker access
# Get the current user's UID and GID
CURRENT_UID=$(id -u)
CURRENT_GID=$(id -g)

# Set permissions to allow Docker access
if ! chmod 770 ${EZBIDS_TMP_DIR} 2>/dev/null; then
echo "Warning: Unable to set permissions on ${EZBIDS_TMP_DIR}"
echo "You may need to run one of the following commands with sudo:"
echo " sudo chmod 770 ${EZBIDS_TMP_DIR}"
echo " sudo chown ${CURRENT_UID}:${CURRENT_GID} ${EZBIDS_TMP_DIR}"
echo "Alternatively, you can set EZBIDS_TMP_DIR in your .env file to a directory you own."
exit 1
fi

if ! chown ${CURRENT_UID}:${CURRENT_GID} ${EZBIDS_TMP_DIR} 2>/dev/null; then
echo "Warning: Unable to set ownership on ${EZBIDS_TMP_DIR}"
echo "You may need to run:"
echo " sudo chown ${CURRENT_UID}:${CURRENT_GID} ${EZBIDS_TMP_DIR}"
echo "Alternatively, you can set EZBIDS_TMP_DIR in your .env file to a directory you own."
exit 1
fi

# ok docker compose is now included in docker as an option for docker
if [[ $(command -v docker-compose) ]]; then
# if the older version is installed use the dash
Expand Down