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

MongoDB usage on docker-compoose #1

Open
enric1994 opened this issue Oct 14, 2020 · 0 comments
Open

MongoDB usage on docker-compoose #1

enric1994 opened this issue Oct 14, 2020 · 0 comments

Comments

@enric1994
Copy link

Hola!

I am trying to run the docker-compose but I get this error message: news-scraper-workers-historic-go_1 | Addr: localhost:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: dial tcp 127.0.0.1:27017: connect: connection refused
I think the error is produced because I don't have any MongoDB instance running. In order to solve the error I added MongoDB to the docker-compose script (whithout luck):

  mongodb:
        image: mongo:latest
        container_name: mongodb
        restart: always
        environment:
            MONGO_INITDB_ROOT_USERNAME: admin
            MONGO_INITDB_ROOT_PASSWORD: admin
            MONGO_INITDB_DATABASE: news-scraped-with-tags
        ports:
            - 27017:27017
        volumes:
            - ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro

Can you explain how to add MongoDB to docker-compose (default username, password...) and what to do after running docker-compose up?

Thanks for creating this tool, keep it up!

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

1 participant