Skip to content

Commit

Permalink
Merge pull request #69 from nasa/feature/MEDITOR-937-upgrade-and-simp…
Browse files Browse the repository at this point in the history
…lify-meditor

Feature/meditor 937 upgrade and simplify meditor
  • Loading branch information
joncarlson authored Jan 3, 2025
2 parents 0a0e0f7 + 6f2d50b commit dd7d990
Show file tree
Hide file tree
Showing 156 changed files with 9,781 additions and 25,121 deletions.
11 changes: 11 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
NODE_ENV=development

HOST=http://localhost/meditor # No docker? http://localhost:3000/meditor
NEXTAUTH_URL=http://localhost/meditor/api/auth # No docker? http://localhost:3000/meditor/api/auth
NEXTAUTH_URL_INTERNAL=http://meditor_app:3000/meditor/api/auth # No docker? http://localhost:3000/meditor/api/auth
NEXTAUTH_SECRET=ThisSecretEncryptsTheAuthJWTToken

# uncomment if running Mongo outside of Docker
#MONGO_URL=mongodb://localhost:27017/

# uncomment if running NATS outside of Docker
# MEDITOR_NATS_SERVER=nats://localhost:4222 # if running NATS outside of Docker

# include in your .env to disable email notifications, if disabled you will see the email in the logs instead of an actual
# email being sent
DISABLE_EMAIL_NOTIFICATIONS=true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: app-node-${{ matrix.node }}
strategy:
matrix:
node: [16] # One or more Node versions to test against
node: [22] # One or more Node versions to test against
fail-fast: true

steps:
Expand Down
32 changes: 32 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
http_port 8080
debug
}

:8080 {
log {
output stdout
format console
level INFO
}

handle /meditor* {
reverse_proxy {$APP_HOST}:3000
}

handle /meditor/docs* {
reverse_proxy {$DOCS_HOST}:3030
}

handle /meditor/notebookviewer* {
reverse_proxy {$NOTEBOOKVIEWER_HOST}:8080
}

handle /meditor/monitor* {
reverse_proxy {$MONITOR_HOST}:9000
}

handle /meditor/monitor/api/websocket* {
reverse_proxy {$MONITOR_HOST}:9000
}
}
68 changes: 0 additions & 68 deletions buildspec.yml

This file was deleted.

77 changes: 0 additions & 77 deletions docker-compose.override.yml

This file was deleted.

73 changes: 62 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
services:
notebookviewer:
depends_on:
- legacy-api
container_name: meditor_notebookviewer
build: packages/notebook-viewer
environment:
- FLASK_ENV=development
env_file:
- .env
volumes:
- ./packages/notebook-viewer:/usr/src/app

proxy:
container_name: meditor_proxy
image: caddy:2.7-alpine
restart: on-failure
ports:
- "127.0.0.1:80:8080"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
environment:
- APP_HOST=${APP_HOST:-meditor_app}
- DOCS_HOST=${DOCS_HOST:-meditor_docs}
- MONITOR_HOST=${MONITOR_HOST:-meditor_monitor}
- NOTEBOOKVIEWER_HOST=${NOTEBOOKVIEWER_HOST:-meditor_notebookviewer}
depends_on:
- legacy-api
- nats
- app
- database
Expand All @@ -16,36 +31,72 @@ services:
notifier:
depends_on:
- nats
container_name: meditor_notifier
build: packages/notifier
restart: on-failure
env_file:
- .env
volumes:
- ./packages/notifier:/usr/src/app
- /usr/src/app/node_modules

app:
depends_on:
- legacy-api
container_name: meditor_app
build: packages/app
restart: on-failure
env_file:
- .env
ports:
- "127.0.0.1:3000:3000"
develop:
watch:
- action: sync
path: ./packages/app
target: /usr/src/app
ignore:
- node_modules/
- .next/
- action: rebuild
path: ./packages/app/package.json

docs:
container_name: meditor_docs
build: packages/docs
env_file:
- .env
ports:
- "127.0.0.1:3030:3030"
depends_on:
- legacy-api
- app

legacy-api:
depends_on:
- database
- nats

database:
image: ${REGISTRY}mongo:4.1.4
container_name: meditor_database
volumes:
- ./mongo-data:/data/db
ports:
- "127.0.0.1:27018:27017"

nats:
image: ${REGISTRY}nats-streaming:0.15.1
container_name: meditor_nats
volumes:
- ./nats-data:/nats/data
ports:
- "127.0.0.1:4222:4222"
- "127.0.0.1:8222:8222"

monitor:
image: ${REGISTRY}portainer/portainer:1.20.0
container_name: meditor_monitor
command: -H unix:///var/run/docker.sock
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- monitor-data:/data

agent:
image: ${REGISTRY}portainer/agent:1.1.2
container_name: meditor_agent
environment:
AGENT_CLUSTER_ADDR: tasks.agent
volumes:
Expand Down
3 changes: 2 additions & 1 deletion packages/app/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
npm-debug.log
npm-debug.log
.env.local
2 changes: 1 addition & 1 deletion packages/app/.env.development
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DB_NAME=meditor
NEXT_PUBLIC_API_BASE_PATH='/meditor/api'
NEXT_PUBLIC_IMAGE_UPLOAD_URL='https://lb.gesdisc.eosdis.nasa.gov/images/upload'
NEXT_PUBLIC_NOTEBOOKVIEWER_URL='/meditor/notebookviewer/'
NEXT_PUBLIC_NOTEBOOKVIEWER_URL='/meditor/notebookviewer/'
2 changes: 1 addition & 1 deletion packages/app/.env.production
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DB_NAME=meditor
NEXT_PUBLIC_API_BASE_PATH='/meditor/api'
NEXT_PUBLIC_IMAGE_UPLOAD_URL='https://lb.gesdisc.eosdis.nasa.gov/images/upload'
NEXT_PUBLIC_NOTEBOOKVIEWER_URL='/meditor/notebookviewer/'
NEXT_PUBLIC_NOTEBOOKVIEWER_URL='/meditor/notebookviewer/'
6 changes: 5 additions & 1 deletion packages/app/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"extends": "next/core-web-vitals"
"extends": "next/core-web-vitals",
"rules": {
"react-hooks/exhaustive-deps": "off",
"@next/next/no-html-link-for-pages": 1
}
}
4 changes: 2 additions & 2 deletions packages/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG REGISTRY
FROM ${REGISTRY}node:16.11.1
FROM ${REGISTRY}node:22.11.0

ENV NPM_CONFIG_LOGLEVEL warn
ARG node_env
Expand All @@ -18,5 +18,5 @@ CMD if [ "$NODE_ENV" = "production" ]; \
then \
npm run start; \
else \
npm run dev; \
npm run docker:dev; \
fi
Loading

0 comments on commit dd7d990

Please sign in to comment.