-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tim Budras
authored and
Tim Budras
committed
Sep 30, 2024
1 parent
8b1b26c
commit d4e70aa
Showing
5 changed files
with
152 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
version: "3" | ||
networks: | ||
ezbids: | ||
|
||
services: | ||
mongodb: | ||
container_name: brainlife_ezbids-mongodb | ||
image: mongo:4.4.15 | ||
platform: linux/amd64 | ||
volumes: | ||
- /data/db | ||
healthcheck: | ||
test: echo 'db.runCommand("ping").ok' | mongo localhost:27017/test --quiet | ||
interval: 10s | ||
timeout: 10s | ||
retries: | ||
5 | ||
networks: | ||
- ezbids | ||
|
||
api: | ||
container_name: brainlife_ezbids-api | ||
build: . | ||
platform: linux/amd64 | ||
volumes: | ||
- ./api:/app/api | ||
- /tmp:/tmp | ||
depends_on: | ||
mongodb: | ||
condition: service_healthy | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:8082/health"] | ||
working_dir: /app/api | ||
command: | ||
./dev.sh | ||
environment: | ||
MONGO_CONNECTION_STRING: mongodb://mongodb:27017/ezbids | ||
BRAINLIFE_AUTHENTICATION: ${BRAINLIFE_AUTHENTICATION} | ||
networks: | ||
- ezbids | ||
|
||
handler: | ||
container_name: brainlife_ezbids-handler | ||
build: ./handler | ||
platform: linux/amd64 | ||
volumes: | ||
- .:/app | ||
- /tmp:/tmp | ||
depends_on: | ||
mongodb: | ||
condition: service_healthy | ||
api: | ||
condition: service_healthy | ||
environment: | ||
MONGO_CONNECTION_STRING: mongodb://mongodb:27017/ezbids | ||
networks: | ||
- ezbids | ||
tty: true #turn on color for bids-validator output | ||
command: pm2 start handler.js --attach | ||
|
||
ui: | ||
container_name: brainlife_ezbids-ui-builder | ||
env_file: | ||
- .env | ||
build: ./ui/Dockerfile-production | ||
platform: linux/amd64 | ||
volumes: | ||
- ./ui/dist:/ui/dist | ||
environment: | ||
VITE_APIHOST: https://${SERVER_NAME}/api | ||
VITE_BRAINLIFE_AUTHENTICATION: ${BRAINLIFE_AUTHENTICATION} | ||
|
||
# by default this is not enabled, need to run docker compose with --profile development to enable this service | ||
telemetry: | ||
container_name: brainlife_ezbids-telemetry | ||
build: ./telemetry | ||
platform: linux/amd64 | ||
depends_on: | ||
- mongodb | ||
profiles: ["development"] | ||
networks: | ||
- ezbids | ||
|
||
nginx: | ||
env_file: | ||
- .env | ||
container_name: brainlife_ezbids-nginx | ||
depends_on: | ||
- ui | ||
- api | ||
image: nginx:latest | ||
platform: linux/amd64 | ||
ports: | ||
- 80:80 | ||
- 443:443 | ||
networks: | ||
- ezbids | ||
volumes: | ||
- ./nginx/ssl:/etc/nginx/conf.d/ssl/ | ||
- ./nginx/production_nginx.conf:/etc/nginx/conf.d/default.conf | ||
- ./ui/dist:/usr/share/nginx/html/ezbids:ro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ex | ||
|
||
BRAINLIFE_AUTHENTICATION=true | ||
while getopts "d" flag; do | ||
case $flag in | ||
d) | ||
BRAINLIFE_AUTHENTICATION=false | ||
;; | ||
\?) | ||
;; | ||
esac | ||
done | ||
|
||
export BRAINLIFE_AUTHENTICATION | ||
|
||
git submodule update --init --recursive | ||
|
||
(cd api && npm install) | ||
(cd ui && npm install) | ||
|
||
mkdir -p /tmp/upload | ||
mkdir -p /tmp/workdir | ||
|
||
./generate_keys.sh | ||
|
||
# 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 | ||
docker-compose --file docker-compose-production.yml up | ||
else | ||
# if the newer version is installed don't use the dash | ||
docker compose --file docker-compose-production.yml up | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM node:20 | ||
|
||
COPY . /ui | ||
WORKDIR /ui | ||
|
||
RUN npm install | ||
|
||
CMD [ "npm", "run", "build"] | ||
|