I have a dockerized service, It consists in a server with an API REST and a mongoDB storage system.
First of all I have these two images of docker hub:
- mongo:3.6.0
- node:alpine
I'm trying to create a backup with a snapshot from my server. When I performed the restoration and I started to wake up the services, mongoDB crashed. This is the error log:
mongo_1 | 2018-01-09T18:50:17.770+0000 F STORAGE
[initandlisten] Unable to start up mongod due to missing featureCompatibilityVersion document.
mongo_1 | 2018-01-09T18:50:17.774+0000 F STORAGE
[initandlisten] Please run with --repair to restore the document.
mongo_1 | 2018-01-09T18:50:17.774+0000 F -
[initandlisten] Fatal Assertion 40652 at src/mongo/db/db.cpp 660
mongo_1 | 2018-01-09T18:50:17.775+0000 F - [initandlisten]
This is my Dockerfile:
FROM node:alpine
RUN mkdir /CSCFUTSAL
WORKDIR /CSCFUTSAL
COPY package.json /CSCFUTSAL
RUN cd /CSCFUTSAL
RUN npm install
RUN npm install -g @angular/cli
COPY . /CSCFUTSAL
RUN ng build --prod
EXPOSE 80
And my docker-compose.yml:
version: '2'
services:
mongo:
image: mongo:3.6.0
volumes:
- /data/mongodb/db:/data/db
ports:
- "27017:27017"
api:
build: .
command: node ./bin/www
volumes:
- api-img:/CSCFUTSAL/public/plantillas
ports:
- "80:80"
links:
- mongo
volumes:
api-img:
driver: local
I dont know how to repair this without losing the data stored.