Reputation: 67
I have a web page project developed in MEAN stack instanced in a server with Docker.
I have 2 container running, one has the API and the service, the other runs the mongodb service. Everything seems right but I have one big problem, in certain periods of time, the system drops my databases.
The last issue was on 11/03/2018 and the previous one 2 week ago. These are the mongodb container last logs:
There is any configuration that maybe I can edit, or do you have passed through this problem?
If you need more information please do ask. Thanks.
Upvotes: 1
Views: 363
Reputation: 5770
Your database gets accessed from an external (public) IP. Your MongoDB server is publicly accessible and you have no authentication activated.
This official doc describes how you can enable authentication: https://docs.mongodb.com/manual/tutorial/enable-authentication/
Furthermore: You can restrict access to the server. If your app server and your mongodb server are in the same network, you need not to expose your mongodb to the public.
Upvotes: 3