Comments (7)
I think you shouldn't remove mongo service, since Meteor app needs to connect to a database, that's why you are getting that error.
from meteor-base.
@diavrank i already removed. There is only one service app
with external MONGO_URL=mongodb://root:[email protected]:27017/meteor
. But error shows me that I am trying to connect 127.0.01:27017
. So, what can be the case?
from meteor-base.
I don't know why you remove the mongo service. I imagine that you have a meteor app which doesn't need a database (maybe because is only a website or front-end app), so, in that case you can use MONGO_URL=none
according to this link
from meteor-base.
@diavrank my MongoDB is managed instance I do not need to deploy it as a docker container. So, I removed it. And I am passing MONGO_URL=mongodb://root:[email protected]:27017/meteor
from meteor-base.
Here is my docker-compose.
version: '3'
services:
app:
build:
context: .
dockerfile: Dockerfile
ports:
- '80:3000'
depends_on:
- mongo
environment:
ROOT_URL: ${APP_ROOT_URL:-http://localhost}
MONGO_URL: mongodb://root:[email protected]:27017/meteor
PORT: 3000
from meteor-base.
ok, now I understand, so, in that case you need to specify a public IP address or domain in order to establish a successful connection, since if you use a local IP address like 192.168.0.100, docker will try to find it inside the docker network (a network created by default which is used by the containers defined in the docker-compose file). Your compose file should be like this:
version: '3'
services:
app:
build:
context: .
dockerfile: Dockerfile
ports:
- '80:3000'
environment:
ROOT_URL: ${APP_ROOT_URL:-http://localhost}
MONGO_URL: mongodb://root:[email protected]:27017/meteor?authSource=admin
PORT: 3000
Also, you can use a cloud service like Mongo Atlas, and your compose file should be like this:
version: '3'
services:
app:
build:
context: .
dockerfile: Dockerfile
ports:
- '80:3000'
environment:
ROOT_URL: ${APP_ROOT_URL:-http://localhost}
MONGO_URL: mongodb+srv://user:[email protected]/databaseName?retryWrites=true&w=majority
PORT: 3000
In my opinion, I don't recommend you to use Mongo Atlas in free tier because you can experience speed issues with your app.
On the other hand, I recommend you if you are using docker in you personal computer, you'll need to migrate the database server to a docker container in order to achieve the connection with your app service. I don't know if exists a way to connect a docker container with a service in the host machine.
from meteor-base.
Closing as this isn’t an issue with this project.
from meteor-base.
Related Issues (20)
- New CVE-2022-0778 HOT 2
- Include 2.5.7-beta.0 HOT 1
- '/root/.meteor' exists, but '/root/.meteor/meteor' is not executable. HOT 32
- Proxy Configuration HOT 1
- Add better minification and obfuscation HOT 1
- Error with Vite bundler for Meteor + Vue 3 app HOT 5
- Missing 2.8.1 tag on docker hub HOT 1
- Missing 2.9.0 & 2.9.1 tags on Docker hub HOT 1
- No ark available HOT 1
- TypeError in docker HOT 1
- Error: Could not get https://warehouse.meteor.com HOT 2
- Add ssh to base image to install dependencies directly from Git/Github HOT 1
- app not available at localhost HOT 1
- Missing 2.8.2 tag on docker hub HOT 1
- build-meteor-bundle.sh error HOT 2
- No version needed in `docker-compose.yml` and updates to reflect latest changes in the docker ecosystem HOT 1
- update.sh adds duplicated lines to support.sh HOT 1
- Missing 2.15 tag on Docker hub HOT 2
- Development version? HOT 1
- Add `--settings` Support to Package` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meteor-base.