-
Notifications
You must be signed in to change notification settings - Fork 0
Added Docker setup, docker-compose, .env.example, and updated README #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # MongoDB Credentials for the local Docker container | ||
| MONGO_USERNAME=root | ||
| MONGO_PASSWORD=root | ||
|
|
||
| # Mongo-Express UI Credentials | ||
| MONGO_EXPRESS_USERNAME=admin | ||
| MONGO_EXPRESS_PASSWORD=admin | ||
|
|
||
| # Rerum server settings | ||
| PORT=3001 | ||
| RERUM_API_VERSION=1.0.0 | ||
| COLLECTION_ACCEPTEDSERVER=acceptedServer | ||
| COLLECTION_V0=annotation | ||
| AUDIENCE=http://rerum.io/api | ||
| ISSUER_BASE_URL=https://example.auth0.com/ | ||
| RERUM_BASE=http://localhost:3001 | ||
| RERUM_PREFIX=http://localhost:3001/v1/ | ||
| RERUM_ID_PREFIX=http://localhost:3001/v1/id/ | ||
| RERUM_AGENT_CLAIM=http://store.rerum.io/agent | ||
| RERUM_CONTEXT=http://store.rerum.io/v1/context.json | ||
| RERUM_API_DOC=http://localhost:3001/v1/API.html | ||
|
|
||
| # The local MongoDB connection string | ||
| MONGO_CONNECTION_STRING=mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@mongo:27017/ | ||
| MONGODBNAME=annotationStore | ||
| MONGODBCOLLECTION=alpha | ||
|
|
||
| # Read only mode | ||
| DOWN=false | ||
| READONLY=false | ||
|
|
||
| # Auth0 and bot secrets (replace with fake values for local use) | ||
| CLIENT_ID=dummy_client_id | ||
| CLIENT_SECRET=dummy_client_secret | ||
| BOT_TOKEN=dummy_bot_token | ||
| BOT_AGENT=http://devstore.rerum.io/v1/id/dummy_agent | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
|
|
||
| FROM node | ||
|
|
||
| # Set the working directory inside the container. | ||
| WORKDIR /app | ||
|
|
||
| # Copy package.json and package-lock.json first to leverage Docker's build cache. | ||
| COPY package*.json ./ | ||
|
|
||
| # Install application dependencies. | ||
| RUN npm install | ||
|
|
||
| # Copy the rest of the application code. | ||
| COPY . . | ||
|
|
||
| # Expose the port the app runs on. | ||
| EXPOSE 3001 | ||
|
|
||
| # The command to start the application. | ||
| CMD ["node", "./bin/rerum_v1.js"] |
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think in general we are really expecting this to change to reflect that it is the community edition. For example, the |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -77,6 +77,44 @@ MONGODBCOLLECTION = OBTAINED_FROM_MONGODB_SET_UP | |||||||||||||||||||||||||||||||||||||||
| DOWN = false | ||||||||||||||||||||||||||||||||||||||||
| READONLY = false | ||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||
| #### Add .env.example instructions | ||||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this an old note-to-self? |
||||||||||||||||||||||||||||||||||||||||
| ##### Using `.env.example` for Community Testing | ||||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You probably want this one to be |
||||||||||||||||||||||||||||||||||||||||
| To allow the application to run safely without exposing secrets: | ||||||||||||||||||||||||||||||||||||||||
| 1. Copy the example environment file to `.env`: | ||||||||||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||||||||||
| cp .env.example .env | ||||||||||||||||||||||||||||||||||||||||
| 2. .env.example contains dummy values for all required variables. You do not need real credentials to run the app locally. | ||||||||||||||||||||||||||||||||||||||||
| 3. Note: | ||||||||||||||||||||||||||||||||||||||||
| Write actions (create, update, delete) may not work without valid Auth0 credentials. | ||||||||||||||||||||||||||||||||||||||||
| You can still explore the API, MongoDB, and UI for testing purposes. | ||||||||||||||||||||||||||||||||||||||||
| #### Instructions | ||||||||||||||||||||||||||||||||||||||||
| 1. Running the RERUM API with Docker | ||||||||||||||||||||||||||||||||||||||||
| Ensure Docker and Docker Compose are installed. | ||||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think you want 'ensure' to be lowercase |
||||||||||||||||||||||||||||||||||||||||
| Copy the example environment file: | ||||||||||||||||||||||||||||||||||||||||
| bash | ||||||||||||||||||||||||||||||||||||||||
| Copy code | ||||||||||||||||||||||||||||||||||||||||
| cp .env.example .env | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+94
to
+96
|
||||||||||||||||||||||||||||||||||||||||
| bash | |
| Copy code | |
| cp .env.example .env | |
| ```bash | |
| cp .env.example .env | |
| ``` |
Copilot
AI
Nov 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bash code block is not properly closed. Line 85 starts a code block with triple backticks but there's no closing triple backticks before line 86, which continues the numbered list. Add a closing ``` after line 85 to properly terminate the code block.
Copilot
AI
Nov 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation structure is confusing with nested headings under a numbered list item. Line 90 has a level-4 heading '#### Instructions' appearing inside item 3 of the list, and line 91 starts a new numbered list (1.) that's nested under the same item 3. This should be restructured so that the 'Instructions' section and its numbered steps are at the proper level, not nested inside item 3.
| #### Instructions | |
| 1. Running the RERUM API with Docker | |
| Ensure Docker and Docker Compose are installed. | |
| Copy the example environment file: | |
| bash | |
| Copy code | |
| cp .env.example .env | |
| 2. Build and start the containers: | |
| bash | |
| Copy code | |
| docker-compose up --build | |
| #### Instructions | |
| 1. Running the RERUM API with Docker | |
| Ensure Docker and Docker Compose are installed. | |
| Copy the example environment file: | |
| ```bash | |
| cp .env.example .env |
- Build and start the containers:
docker-compose up --build
Copilot
AI
Nov 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code block syntax is incorrect. Lines 99-101 have the same formatting issue as the previous code block - 'bash' and 'Copy code' are written as plain text. This should use proper markdown code block syntax with triple backticks, and 'Copy code' should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did these come out in the format you expect? They are all on the same line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oo what's Mongo Express? You might need to explain what this is somewhere in the readme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oo what's this Local Auth0? You might need to explain what this is somewhere in the readme.
Copilot
AI
Nov 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code block syntax is incorrect. Lines 109-111 have the same formatting issue - 'bash' and 'Copy code' are written as plain text instead of using proper markdown code block syntax with triple backticks. 'Copy code' should be removed.
Copilot
AI
Nov 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The numbered list continues items 4, 5, and 6 at the same level as the nested 'Instructions' section, creating a confusing structure. Items 4-6 appear to be additional notes about the Docker setup but they're formatted as if they're part of the original numbered list that started at line 83. These should either be reformatted as a separate list or integrated properly into the Docker instructions section.
| 4. This setup uses dummy credentials so the API runs safely. For full Auth0 functionality, replace the dummy values in .env with real credentials. | |
| 5. The .env.example file contains safe dummy credentials: | |
| Auth0 CLIENT_ID, CLIENT_SECRET | |
| Bot tokens | |
| 6. You can safely run the application with these values without affecting real data. | |
| #### Notes | |
| - This setup uses dummy credentials so the API runs safely. For full Auth0 functionality, replace the dummy values in .env with real credentials. | |
| - The .env.example file contains safe dummy credentials: | |
| - Auth0 CLIENT_ID, CLIENT_SECRET | |
| - Bot tokens | |
| - You can safely run the application with these values without affecting real data. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| services: | ||
| rerum: | ||
| build: . | ||
| container_name: rerum-server | ||
| restart: always | ||
| ports: | ||
| - "3001:3001" | ||
| env_file: .env | ||
| environment: | ||
| - MONGO_CONNECTION_STRING=mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@mongo:27017/ | ||
| depends_on: | ||
| - localauth0 # Restored dependency on localauth0 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment is confusing |
||
| - mongo | ||
|
|
||
| mongo: | ||
| image: mongo | ||
| container_name: rerum-mongo | ||
| restart: always | ||
| ports: | ||
| - "27017:27017" | ||
| volumes: | ||
| - mongo-data:/data/db | ||
| environment: | ||
| - MONGO_INITDB_ROOT_USERNAME=${MONGO_USERNAME} | ||
| - MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD} | ||
|
|
||
| mongo-express: | ||
| image: mongo-express | ||
| container_name: rerum-mongo-express | ||
| restart: always | ||
| ports: | ||
| - "8081:8081" | ||
| environment: | ||
| - ME_CONFIG_MONGODB_ADMINUSERNAME=${MONGO_USERNAME} | ||
| - ME_CONFIG_MONGODB_ADMINPASSWORD=${MONGO_PASSWORD} | ||
| - ME_CONFIG_MONGODB_URL=mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@mongo:27017/ | ||
| - ME_CONFIG_BASICAUTH_USERNAME=${MONGO_EXPRESS_USERNAME} | ||
| - ME_CONFIG_BASICAUTH_PASSWORD=${MONGO_EXPRESS_PASSWORD} | ||
| depends_on: | ||
| - mongo | ||
|
|
||
| # RESTORED SERVICE - Uses port 3002 and includes the debugging command | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment is confusing. |
||
| localauth0: | ||
| image: public.ecr.aws/primaassicurazioni/localauth0:0.8.2 | ||
| container_name: rerum-localauth0 | ||
| restart: always | ||
| healthcheck: | ||
| test: ["CMD", "/localauth0", "healthcheck"] | ||
| ports: | ||
| - "3002:3002" | ||
| env_file: .env | ||
| depends_on: | ||
| - mongo | ||
| # CRITICAL DEBUGGING STEP: Forces the application to run in the foreground. | ||
| # This will dump the startup error (which is causing ERR_EMPTY_RESPONSE) directly to your console. | ||
| command: /localauth0 | ||
|
|
||
| volumes: | ||
| mongo-data: | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MONGO_CONNECTION_STRING uses variable substitution syntax (${MONGO_USERNAME} and ${MONGO_PASSWORD}) which will not be expanded in a .env file. Most .env parsers (including dotenv) do not perform variable substitution. This line should either use the literal values 'root' and 'root' directly as 'mongodb://root:root@mongo:27017/', or include a comment explaining that this value will be overridden by the docker-compose.yml environment section.