Hi, I created a new docker compose file for my unifi controller after linuxserver.io changed their docker image to not include mongodb.
But the mongodb always crashes after a while.
I have tested mongodb version 3.6 to 4.0, all with the same result.
Version >4.0 seems to need armv8.2.
Host:
Platform: Raspberry Pi 4
OS: Ubuntu 23.10 aarch64 (armv8)
Kernel: 6.5.0-1005-raspi
RAM: 4GB
Docker: 24.0.6, build ed223bc
docker-compose.yml:
version: "3.8"
services:
app:
image: lscr.io/linuxserver/unifi-network-application:latest
container_name: unifi_app
hostname: unifi_app
restart: always
volumes:
- /etc/localtime:/etc/localtime:ro
- /docker/unifi_stack/app/conf:/config:rw
networks:
macvlan_lan:
ipv4_address: 10.1.1.1
backend:
environment:
- PUID=1000
- PGID=1000
- MONGO_USER=unifi
- MONGO_PASS=foobar
- MONGO_HOST=unifi_db
- MONGO_PORT=27017
- MONGO_DBNAME=unifi
db:
image: mongo:3.6
container_name: unifi_db
hostname: unifi_db
restart: always
volumes:
- /etc/localtime:/etc/localtime:ro
- /docker/unifi_stack/db/data:/data/db
- /docker/unifi_stack/db/conf/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
networks:
backend:
networks:
backend:
init-mongo.js:
db.getSiblingDB(“unifi”).createUser({user: “unifi”, pwd: “foobar”, roles: [{role: “dbOwner”, db: “unifi”}, {role: “dbOwner”, db: “unifi_stat”}]});
Log:
2023-10-20T16:29:36.757+0200 I NETWORK [initandlisten] waiting for connections on port 27017
2023-10-20T16:29:46.865+0200 I CONTROL [signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends
2023-10-20T16:29:46.866+0200 I NETWORK [signalProcessingThread] shutdown: going to close listening sockets...
2023-10-20T16:29:46.866+0200 I NETWORK [signalProcessingThread] removing socket file: /tmp/mongodb-27017.sock
2023-10-20T16:29:46.866+0200 I FTDC [signalProcessingThread] Shutting down full-time diagnostic data capture
2023-10-20T16:29:46.871+0200 I STORAGE [signalProcessingThread] WiredTigerKVEngine shutting down
2023-10-20T16:29:47.018+0200 I STORAGE [signalProcessingThread] shutdown: removing fs lock...
2023-10-20T16:29:47.018+0200 I CONTROL [signalProcessingThread] now exiting
2023-10-20T16:29:47.019+0200 I CONTROL [signalProcessingThread] shutting down with code:0