Skip to content

Commit

Permalink
change/docker-compose-localhost (#3703)
Browse files Browse the repository at this point in the history
Lagt til docker-compose.yml for lokal kjøring av applikasjoner.
  • Loading branch information
rfc3092 authored Dec 19, 2024
1 parent c79b2ee commit 8f6bf98
Show file tree
Hide file tree
Showing 18 changed files with 136 additions and 8 deletions.
2 changes: 2 additions & 0 deletions apps/brreg-stub/docker-compose.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SELECT 'CREATE DATABASE "testnav-brregstub"'
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'testnav-brregstub')\gexec
11 changes: 11 additions & 0 deletions apps/brreg-stub/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:

postgresql:
image: postgres
network_mode: host
shm_size: 128mb
environment:
POSTGRES_PASSWORD: ""
POSTGRES_HOST_AUTH_METHOD: trust
volumes:
- ./docker-compose.sql:/docker-entrypoint-initdb.d/init.sql
28 changes: 28 additions & 0 deletions apps/dolly-backend/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
services:

cloud_sql_proxy:
image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.14.2
network_mode: host
command:
- "dolly-dev-ff83:europe-north1:testnav-dolly-backend-local"
- "--credentials-file=/application_default_credentials.json"
- "--run-connection-test"
volumes:
- type: bind
# Set a variable $DOLLY_APPLICATION_CREDENTIALS. We don't use
# GOOGLE_APPLICATION_CREDENTIALS, as this causes an extra step during login.
#
# - $HOME/.config/gcloud/application_default_credentials.json for Linux/macOS.
# - $APPDATA/gcloud/application_default_credentials.json for Windows.
source: $DOLLY_APPLICATION_CREDENTIALS
target: /application_default_credentials.json

opensearch:
image: opensearchproject/opensearch:latest
ports:
- "9200:9200"
- "9600:9600"
environment:
discovery.type: single-node
plugins.security.disabled: "true"
OPENSEARCH_INITIAL_ADMIN_PASSWORD: YLAgOm}rz#o6#Aq
11 changes: 11 additions & 0 deletions apps/oppsummeringsdokument-service/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:

opensearch:
image: opensearchproject/opensearch:latest
ports:
- "9200:9200"
- "9600:9600"
environment:
discovery.type: single-node
plugins.security.disabled: "true"
OPENSEARCH_INITIAL_ADMIN_PASSWORD: YLAgOm}rz#o6#Aq
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

@Profile("prod")
@Configuration
public class OpensearchConfig extends AbstractOpenSearchConfiguration {
public class OpenSearchConfig extends AbstractOpenSearchConfiguration {

@Value("${open.search.username}")
private String username;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package no.nav.testnav.apps.oppsummeringsdokumentservice.config;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.opensearch.client.RestHighLevelClient;
import org.opensearch.data.client.orhlc.AbstractOpenSearchConfiguration;
Expand All @@ -9,13 +8,12 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;

import java.time.Duration;

@Slf4j
@Configuration
@Profile("dev")
@Profile("local")
public class OpenSearchLocalConfig extends AbstractOpenSearchConfiguration {

@Value("${open.search.uri}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

@EnableWebSecurity
@Configuration
@Profile({ "prod", "dev" })
@Profile({ "prod", "local" })
public class SecurityConfig {

@Bean
Expand Down
18 changes: 18 additions & 0 deletions apps/organisasjon-forvalter/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
services:

cloud_sql_proxy:
image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.14.2
network_mode: host
command:
- "dolly-dev-ff83:europe-north1:testnav-organisasjon-forvalter-local"
- "--credentials-file=/application_default_credentials.json"
- "--run-connection-test"
volumes:
- type: bind
# Set a variable $DOLLY_APPLICATION_CREDENTIALS. We don't use
# GOOGLE_APPLICATION_CREDENTIALS, as this causes an extra step during login.
#
# - $HOME/.config/gcloud/application_default_credentials.json for Linux/macOS.
# - $APPDATA/gcloud/application_default_credentials.json for Windows.
source: $DOLLY_APPLICATION_CREDENTIALS
target: /application_default_credentials.json
18 changes: 18 additions & 0 deletions apps/pdl-forvalter/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
services:

cloud_sql_proxy:
image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.14.2
network_mode: host
command:
- "dolly-dev-ff83:europe-north1:testnav-pdl-forvalter-local"
- "--credentials-file=/application_default_credentials.json"
- "--run-connection-test"
volumes:
- type: bind
# Set a variable $DOLLY_APPLICATION_CREDENTIALS. We don't use
# GOOGLE_APPLICATION_CREDENTIALS, as this causes an extra step during login.
#
# - $HOME/.config/gcloud/application_default_credentials.json for Linux/macOS.
# - $APPDATA/gcloud/application_default_credentials.json for Windows.
source: $DOLLY_APPLICATION_CREDENTIALS
target: /application_default_credentials.json
11 changes: 11 additions & 0 deletions apps/person-search-service/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:

opensearch:
image: opensearchproject/opensearch:latest
ports:
- "9200:9200"
- "9600:9600"
environment:
discovery.type: single-node
plugins.security.disabled: "true"
OPENSEARCH_INITIAL_ADMIN_PASSWORD: YLAgOm}rz#o6#Aq
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

@EnableWebSecurity
@Configuration
@Profile({ "prod", "dev" })
@Profile({ "prod", "local" })
public class SecurityConfig {

@Bean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
AZURE_APP_CLIENT_ID: ${sm://azure-app-client-id}
AZURE_APP_CLIENT_SECRET: ${sm://azure-app-client-secret}
TOKEN_X_ISSUER: https://tokenx.dev-gcp.nav.cloud.nais.io

spring:
config:
Expand Down
1 change: 0 additions & 1 deletion apps/testnav-ident-pool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ Identer kan frigjøres og benyttes om igjen
## Lokal kjøring
* [Generelt.](../../docs/local_general.md)
* [Secret Manager.](../../docs/local_secretmanager.md)
* [Lokal PostgreSQL.](../../docs/local_db.md)

2 changes: 2 additions & 0 deletions apps/tps-messaging-service/docker-compose.mqsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DEFINE CHANNEL('Q1_TESTNAV_TPS_MSG_S') CHLTYPE(SVRCONN) MCAUSER('app') REPLACE
SET CHLAUTH('Q1_TESTNAV_TPS_MSG_S') TYPE(ADDRESSMAP) ADDRESS('*') USERSRC(CHANNEL) CHCKCLNT(REQUIRED) DESCR('Allows connection via APP channel') ACTION(REPLACE)
16 changes: 16 additions & 0 deletions apps/tps-messaging-service/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
services:

mq:
image: icr.io/ibm-messaging/mq:latest
environment:
LICENSE: accept
MQ_QMGR_NAME: QM1
MQ_APP_USER: app
MQ_APP_PASSWORD: passw0rd
MQ_ADMIN_USER: admin
MQ_ADMIN_PASSWORD: passw0rd
ports:
- "127.0.0.1:1414:1414"
- "127.0.0.1:9443:9443"
volumes:
- ./docker-compose.mqsc:/etc/mqm/20-config.mqsc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spring:
aad:
issuer-uri: ${AAD_ISSUER_URI}/v2.0
jwk-set-uri: ${AAD_ISSUER_URI}/discovery/v2.0/keys
accepted-audience: ${AZURE_APP_CLIENT_ID}, api:// ${AZURE_APP_CLIENT_ID}
accepted-audience: ${AZURE_APP_CLIENT_ID}, api://${AZURE_APP_CLIENT_ID}

springdoc:
swagger-ui:
Expand Down
2 changes: 2 additions & 0 deletions apps/udi-stub/docker-compose.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SELECT 'CREATE DATABASE "testnav-udistub"'
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'testnav-udistub')\gexec
11 changes: 11 additions & 0 deletions apps/udi-stub/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:

postgresql:
image: postgres
network_mode: host
shm_size: 128mb
environment:
POSTGRES_PASSWORD: ""
POSTGRES_HOST_AUTH_METHOD: trust
volumes:
- ./docker-compose.sql:/docker-entrypoint-initdb.d/init.sql

0 comments on commit 8f6bf98

Please sign in to comment.