Skip to content

Commit 0bd3005

Browse files
authored
Move osem mongo dev image to api repo (#614)
1 parent e21ba2c commit 0bd3005

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

docker-compose.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
version: "2"
1+
version: "3.9"
2+
23
services:
34
db:
4-
image: ghcr.io/mpfeil/osem-dev-mongo:main
5+
build:
6+
context: ./images/mongodb
7+
container_name: osem-dev-mongo
58
ports:
69
- "27017:27017"
710
volumes:

images/mongodb/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM mongo:5
2+
3+
LABEL org.opencontainers.image.source https://github.com/sensebox/openSenseMap-API/tree/master/images/mongodb
4+
LABEL org.opencontainers.image.description "MongoDB development database for openSenseMap API"
5+
6+
COPY ./osem_admin.sh /docker-entrypoint-initdb.d

images/mongodb/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# osem-dev-mongo
2+
3+
MongoDB development database for openSenseMap API

images/mongodb/osem_admin.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
USER=${OSEM_dbuser:-"admin"}
4+
DATABASE=OSeM-api
5+
PASS=${OSEM_dbuserpass:-"admin"}
6+
7+
echo "Creating openSenseMap Admin user..."
8+
mongo OSeM-api --host localhost --eval "db.createUser({user: '$USER', pwd: '$PASS', roles: ['readWrite', 'dbAdmin']});"
9+
echo "openSenseMap Admin user created."

0 commit comments

Comments
 (0)