Added Docker setup, docker-compose, .env.example, and updated README#16
Added Docker setup, docker-compose, .env.example, and updated README#16Devayani1612 wants to merge 1 commit intomainfrom
Conversation
kungfuchicken
left a comment
There was a problem hiding this comment.
Not sure about your dev process, but the comments about "Restored" items that are newly added is confusing. I would remove those comments. This overall makes sens, though, and will be a valuable contribution once those are cleaned up. Thank you!
| environment: | ||
| - MONGO_CONNECTION_STRING=mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@mongo:27017/ | ||
| depends_on: | ||
| - localauth0 # Restored dependency on localauth0 |
There was a problem hiding this comment.
This comment is confusing
| depends_on: | ||
| - mongo | ||
|
|
||
| # RESTORED SERVICE - Uses port 3002 and includes the debugging command |
There was a problem hiding this comment.
This comment is confusing.
There was a problem hiding this comment.
Pull Request Overview
This PR introduces Docker containerization support for the RERUM API, enabling developers to run the application with all dependencies (MongoDB, Mongo Express, and LocalAuth0) in isolated containers. The changes provide a .env.example file with safe dummy credentials for community testing.
Key changes:
- Added Docker Compose configuration with multi-container orchestration (rerum, mongo, mongo-express, localauth0)
- Created Dockerfile for the RERUM API application container
- Added
.env.examplewith dummy credentials for safe local testing - Updated README.md with Docker setup instructions
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| docker-compose.yml | Defines four services (rerum, mongo, mongo-express, localauth0) with port mappings, environment variables, and service dependencies |
| Dockerfile | Builds the Node.js application container with proper dependency installation and startup configuration |
| .env.example | Provides example environment variables with dummy credentials for local Docker testing |
| README.md | Adds documentation for Docker setup process and community testing with .env.example |
| bash | ||
| Copy code | ||
| cp .env.example .env | ||
|
|
There was a problem hiding this comment.
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.
| #### 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 |
There was a problem hiding this comment.
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
| bash | ||
| Copy code | ||
| cp .env.example .env |
There was a problem hiding this comment.
The code block syntax is incorrect. Lines 94-96 appear to be attempting a code block but 'bash' and 'Copy code' are written as plain text rather than using proper markdown code block syntax. This should be formatted as a proper code block with triple backticks: bash on line 94, the command on line 95, and closing on line 96. Remove 'Copy code' which appears to be accidentally copied from another source.
| bash | |
| Copy code | |
| cp .env.example .env | |
| ```bash | |
| cp .env.example .env | |
| ``` |
| 2. Build and start the containers: | ||
| bash | ||
| Copy code | ||
| docker-compose up --build |
There was a problem hiding this comment.
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.
| 3. To stop the containers: | ||
| bash | ||
| Copy code | ||
| docker-compose down |
There was a problem hiding this comment.
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.
| 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. |
There was a problem hiding this comment.
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. |
| RERUM_API_DOC=http://localhost:3001/v1/API.html | ||
|
|
||
| # The local MongoDB connection string | ||
| MONGO_CONNECTION_STRING=mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@mongo:27017/ |
There was a problem hiding this comment.
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.
| MONGO_CONNECTION_STRING=mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@mongo:27017/ | |
| MONGO_CONNECTION_STRING=mongodb://root:root@mongo:27017/ |
thehabes
left a comment
There was a problem hiding this comment.
I will say I do not know much about Docker. I wasn't even sure how to manually test and make sure things are working as expected, so I will be relying on the OSS team's technical knowledge here! Instead of a formal approval (I am not qualified to give it) I left a comment review.
I initiated a Copilot review, please look through the comments and see if any of it makes sense and is worth making a change for.
I also asked Claude about it and got some notes
docker-compose.yml line 56: Remove inline comment or move to previous line
README.md lines 89-117: Fix markdown formatting for code blocks and lists
README.md: Add Docker testing instructions
Documentation: Clarify port usage (3001 for Docker vs 3005 for local)
These changes will ensure the Docker containers build correctly and the documentation is clear and properly formatted.
You will also find some inline comments.
| 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. |
There was a problem hiding this comment.
I don't think you want 'ensure' to be lowercase
| DOWN = false | ||
| READONLY = false | ||
| ``` | ||
| #### Add .env.example instructions |
There was a problem hiding this comment.
Is this an old note-to-self?
| READONLY = false | ||
| ``` | ||
| #### Add .env.example instructions | ||
| ##### Using `.env.example` for Community Testing |
There was a problem hiding this comment.
You probably want this one to be #### for consistency, it probably replaces #### Add .env.example instructions
| Copy code | ||
| docker-compose up --build | ||
|
|
||
| Services will be available at: |
There was a problem hiding this comment.
Did these come out in the format you expect? They are all on the same line
|
|
||
| Services will be available at: | ||
| RERUM API → http://localhost:3001 | ||
| Mongo Express → http://localhost:8081 |
There was a problem hiding this comment.
oo what's Mongo Express? You might need to explain what this is somewhere in the readme.
| Services will be available at: | ||
| RERUM API → http://localhost:3001 | ||
| Mongo Express → http://localhost:8081 | ||
| Local Auth0 → http://localhost:3002 |
There was a problem hiding this comment.
oo what's this Local Auth0? You might need to explain what this is somewhere in the readme.
There was a problem hiding this comment.
I think in general we are really expecting this to change to reflect that it is the community edition. For example, the Who's to Blame? section. You're to blame now.
Title:
Add Docker setup, .env.example, and README updates for community testing
Description:
- Instructions for using .env.example
- Steps to run the application using Docker and Docker Compose
- Notes on keeping .env secrets private
This PR allows others to review and test the Docker configuration safely without exposing sensitive client secrets.