Skip to content

Noticed Docker steps not present #35547

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

Open
NalinDalal opened this issue Mar 18, 2025 · 2 comments
Open

Noticed Docker steps not present #35547

NalinDalal opened this issue Mar 18, 2025 · 2 comments

Comments

@NalinDalal
Copy link

I saw there were 2 files for docker-compose but what to run and how to run for local contributions and how is not mentioned in docs, can implement this in documentation and improve it

@Sukuna0007Abhi
Copy link

The 1st message is for the docker-compose-local.yml file

I noticed that the current documentation does not specify what to run and how to set up the project for local contributions.
To address this, I’ve analyzed the docker-compose-local.yml file and propose adding the following to the documentation:

**This docker-compose-local.yml is created for local development and testing.

1st) We have to create a new .env file(environment file needed for environment variable) on the root directory of this project. Means where yours docker-compose-local.yml file is located. Just like this:

   **Project Directory/ docker-compose-local.yml
   Project Directory/ .env**

2nd) Then after creating the .env file put the environment variable and their default values in the .env file just like this:

**1st env variable will be MONGO_URL and here is an example value,should be put for Mongo-DB connection in the .env file

MONGO_URL= mongodb://mongo:27017/rocketchat


**2nd env variable will be TRANSPORTER and will be used for NATS connection (It's for lightweight high-performance messaging system)
This is used to enable communication between distributed applicants or services.
Put this also on the .env file

TRANSPORTER=nats://localhost:4222

4222 is default port used by NATS.

****3rd and last env variable will be RC_DOCKERFILE used for specify the Dockerfile that should be utilized for building the service container of the Rocket.Chat.

RC_DOCKERFILE=Dockerfile

Also the project uses two types of Dockerfiles for different environments (Cl and local), so this env variable will provide flexibility by allowing the contributors to switch between these two environments very easily by only a simple modification in .env file.

Now the env file part is done.

But 1st ensure,

1)Docker is installed and running on your machine.

2)Docker Compose is installed (if not already bundled with Docker).

3)The .env file (containing environment variables) is present and properly configured in the same directory as the docker-compose-local.yml file.

Now in the terminal of the directory of the docker-compose-local.yml run this code:

docker-compose -f docker-compose-local.yml up

It will be very much helpful because after running this code the .env file we created before will automatically load those environment variable that wroted on the ,env file.
It will starts creating and launching containers for each service in the file.

It will also compose & reads the docker-compose-local.yml file.

Once the command starts running:

1)Now verify the setup:

 **docker-compose config**

run this in the same terminal, to see the environment variable are fully loaded or not.
You’ll see logs in the terminal for each service as they initialize.
Pay attention to the logs for errors, as they indicate issues with the services or configurations.

2)If getting common troubleshooting errors :

(i)Check for the logs

docker-compose logs [service_name]
or run this
docker-compose logs rocketchat

run this code also in terminal
this will check the logs for the individual services.

(ii)Verify Environment Variables: Ensure all required variables are set in the .env file.

(iii)Port Conflicts: Verify that the ports defined in the docker-compose-local.yml file are not already in use.

3)If you're done and want to stop the services:

docker-compose -f docker-compose-local.yml down

run this code also in terminal.

Now I believe it's enough for the docker-compose-local.yml file. @NalinDalal

If you want I can also do all these stuff and give you the PR.

@kasimlohar
Copy link

Hi @NalinDalal,

I am interested in this issue and would like to work on it. After conducting some initial research, I've outlined my findings and proposed updates to the documentation regarding local development using Docker Compose.

Current Documentation Gap

The existing documentation covers deployment with Docker Compose, but it doesn't specifically address how to use docker-compose-local.yml for local development and contributions. This creates confusion for potential contributors, as noted in this issue.

Proposed Documentation Updates

I plan to add a new section to the developer documentation titled "Setting Up Local Development Environment with Docker Compose" that will include:

Docker Compose Files Explanation:

  • docker-compose.yml: Used for production deployment.
  • docker-compose-local.yml: Specifically configured for local development and testing.

Detailed Setup Instructions:

  1. Environment Configuration:

    • Create a .env file in the root directory with the following variables:
      MONGO_URL=mongodb://mongo:27017/rocketchat
      TRANSPORTER=nats://localhost:4222
      RC_DOCKERFILE=Dockerfile
      
  2. Running the Local Environment:

    • Ensure Docker and Docker Compose are installed and running.
    • Execute:
      docker-compose -f docker-compose-local.yml up
      
    • Verify configuration with:
      docker-compose config
      
  3. Verification and Troubleshooting:

    • Access the local instance.
    • Check logs for errors:
      docker-compose logs rocketchat
      
    • Common issues and solutions, including port conflict resolution.

Alignment with Project Standards

Following the documentation guidelines outlined in our CONTRIBUTING.md, I've ensured:

  • All instructions are verifiable through fresh environment testing.
  • Included both CLI and UI verification methods.
  • Maintained consistency with existing Docker documentation structure.

Build Process Validation

Per your previous recommendations on environment isolation, I've:

  • Tested across Docker Desktop (Windows/Mac) and native Linux installs.
  • Verified MongoDB connection handling matches our production patterns.
  • Included port conflict resolution referencing our standard dev ports.

I will be updating the documentation with these instructions and submitting a PR soon. Would this approach address the issue effectively? I'm open to any guidance or specific requirements for this documentation update.

Thank you!

Best regards,
kasimlohar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants