Problem: I can not connect!
- up to date Debian 10
- Docker version 20.10.7, build f0df350
- docker-compose version 1.29.2, build 5becea4c
My docker-compose file:
version: "3.8" services: app: build: . env_file: - .env command: ["npm", "start"] restart: always ports: - 80:3000 external_links: - mongo extra_hosts: - "host.docker.internal:host-gateway" mongo: image: mongo restart: always ports: - 27017:27017 volumes: - ./mongodb/data:/data/db env_file: - .env mongo-seed: build: ./mongo-seed/. links: - mongo volumes: db-data: name: mongodb
extra_hosts: - "host.docker.internal:host-gateway" is the trick. Sadly it does not work.
Apart from my connection problem, I would also like to receive further suggestions for improving my configuration file.
Is it possible to seed a MongoDB database directly with data? I have done the trick with another container.