-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: escape special characters in mongodb password (#87)
* fix: escape special characters in mongodb password * chore: add dockerfile recommendations * Update docker-compose.yaml Co-authored-by: Hege Aalvik <[email protected]> * chore: configure mongodb via spring data props * chore: move java tool input to standard env --------- Co-authored-by: Hege Aalvik <[email protected]>
- Loading branch information
1 parent
a85bab2
commit 29d169d
Showing
8 changed files
with
59 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,11 @@ | ||
version: "3" | ||
services: | ||
|
||
app: | ||
build: . | ||
image: eu.gcr.io/digdir-fdk-infra/service-catalog | ||
environment: | ||
- MONGO_USERNAME=root | ||
- MONGO_PASSWORD=admin | ||
- MONGODB_HOST=mongodb:27017 | ||
- MONGODB_AUTH=admin | ||
- MONGODB_REPLICASET=replicaset | ||
- SSO_HOST=https://sso.staging.fellesdatakatalog.digdir.no | ||
- SERVICE_CATALOG_URI=https://localhost:8080 | ||
ports: | ||
- "9090:8080" | ||
depends_on: | ||
- mongodb | ||
|
||
mongodb: | ||
image: bitnami/mongodb:latest | ||
image: mongo:latest | ||
environment: | ||
- MONGODB_ROOT_PASSWORD=admin | ||
# Activate this if connecting from localhost | ||
- MONGODB_ADVERTISED_HOSTNAME=localhost | ||
- MONGODB_REPLICA_SET_MODE=primary | ||
- MONGODB_REPLICA_SET_KEY=replicaset | ||
- MONGO_INITDB_DATABASE=serviceCatalog | ||
- MONGO_INITDB_ROOT_PASSWORD=adm?i=n | ||
- MONGO_INITDB_ROOT_USERNAME=root | ||
ports: | ||
- "27017:27017" | ||
- "27017:27017" |
22 changes: 22 additions & 0 deletions
22
src/main/kotlin/no/digdir/servicecatalog/configuration/MongoConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package no.digdir.servicecatalog.configuration | ||
|
||
import com.mongodb.client.MongoClient | ||
import org.springframework.beans.factory.annotation.Value | ||
import org.springframework.context.annotation.Bean | ||
import org.springframework.context.annotation.Configuration | ||
import org.springframework.data.mongodb.core.MongoOperations | ||
import org.springframework.data.mongodb.core.MongoTemplate | ||
|
||
|
||
@Configuration | ||
open class MongoConfig( | ||
@Value("\${spring.data.mongodb.database}") | ||
private val database: String | ||
) { | ||
|
||
@Bean | ||
open fun mongoTemplate(mongoClient: MongoClient): MongoOperations { | ||
return MongoTemplate(mongoClient, database) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters