Skip to content

Commit

Permalink
Add mongo in docker
Browse files Browse the repository at this point in the history
  • Loading branch information
akDeveloper committed Jan 14, 2024
1 parent 3090508 commit f63162d
Show file tree
Hide file tree
Showing 7 changed files with 297 additions and 243 deletions.
2 changes: 1 addition & 1 deletion .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.1-cli-buster
FROM php:8.2-cli-buster

WORKDIR "/opt/php"

Expand Down
15 changes: 15 additions & 0 deletions .docker/mongo/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
set -e

user=$MONGO_INITDB_USER
password=$MONGO_INITDB_PWD
db=$MONGO_INITDB_DATABASE

mongosh -u $MONGO_INITDB_ROOT_USERNAME -p $MONGO_INITDB_ROOT_PASSWORD <<EOF
use ${db}
db = db.getSiblingDB("${db}")
db.createUser({
user: "${user}",
pwd: "${password}",
roles: [{ role: "readWrite", db: "${db}"}],
})
EOF
6 changes: 6 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
MONGO_ROOT_USERNAME=root
MONGO_ROOT_PASSWORD=
MONGODB=accounting
MONGODB_USER=admin
MONGODB_PASSWORD=
MONGODB_HOST=accounting-mongo
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ vendor
.phpunit.result.cache
resources/Credentials.json
.vscode
.env
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
],
"require": {
"php": ">=8.1",
"doctrine/collections": "^1.6",
"doctrine/annotations": "^1.7"
"doctrine/collections": "^1.8",
"doctrine/annotations": "^1.14"
},
"require-dev": {
"phpunit/phpunit": "^10.0",
"google/cloud-firestore": "^1.7"
"google/cloud-firestore": "^1.40"
},
"minimum-stability": "stable",
"autoload": {
Expand Down
Loading

0 comments on commit f63162d

Please sign in to comment.