Skip to content
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

Refactor mongo-seed to only use Dockerfile & remove it from docker-compose #21

Closed
wants to merge 1 commit into from

Conversation

w3tsa
Copy link

@w3tsa w3tsa commented Apr 10, 2023

  • The mongo-seed service is removed from the docker-compose.yml file.
  • The mongo-seed service is defined solely in its respective Dockerfile present in the mongo-seed/Dockerfile directory.
  • The prepare_db target in the Makefile is modified to build the mongo-seed image and run it as a container with the required environment variables and network settings. The mongo-seed container is removed after the import activity is completed.

Note: The server target in the Makefile still scales down the mongo-seed service by setting its count to 0 (--scale mongo-seed=0) since it is not defined in the docker-compose.yml file anymore.

- The mongo-seed service is removed from the docker-compose.yml file.
- The mongo-seed service is defined solely in its respective Dockerfile present in the mongo-seed/Dockerfile directory.
- The prepare_db target in the Makefile is modified to build the mongo-seed image and run it as a container with the required environment variables and network settings. The mongo-seed container is removed after the import activity is completed.

Note: The server target in the Makefile still scales down the mongo-seed service by setting its count to 0 (--scale mongo-seed=0) since it is not defined in the docker-compose.yml file anymore.
@keshav2010
Copy link
Collaborator

Hi, I'm not able to successfully test this

2023-04-10T08:52:16.305+0000    error connecting to host: could not connect to server: server selection error: server selection timeout, current topology: { Type: Single, Servers: [{ Addr: mongodb_container:27017, Type: Unknown, Last error: connection() error occurred during connection handshake: dial tcp: lookup mongodb_container on 127.0.0.11:53: no such host }, ] }
make: *** [Makefile:9: prepare_db] Error 1

did you verified this in your local ?

@keshav2010
Copy link
Collaborator

also i had to remove reference to mongo_seed in makefile's server

server:
	docker-compose up -d --build --remove-orphans --scale mongo-seed=0 //remove --scale mongo-seed=0

@keshav2010 keshav2010 changed the title Changes made: Refactor mongo-seed to only use Dockerfile & remove it from docker-compose Apr 10, 2023
@w3tsa w3tsa closed this Apr 30, 2023
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

Successfully merging this pull request may close these issues.

Refactor mongo-seed to only use Dockerfile and remove service from docker-compose
2 participants