Skip to content

Commit

Permalink
readd local debug run config
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Nov 4, 2024
1 parent 429d8d9 commit 2dbbd62
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 42 deletions.
17 changes: 17 additions & 0 deletions .run/OkrApplication-local-prod-debug.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

<component name="ProjectRunConfigurationManager">
<configuration default="false" name="OkrApplication Local-prod debug" type="Remote">
<module name="exam-feedback-tool" />
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<option name="AUTO_RESTART" value="false" />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="5005" />
<option name="LOCAL" value="false" />
</RunnerSettings>
<method v="2" />
</configuration>
</component>
9 changes: 3 additions & 6 deletions backend/src/main/resources/application-staging.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# logging level for staging
logging.level.org.springframework=debug
logging.level.ch.puzzle.okr=DEBUG
#logging.level.org.flywaydb.core=DEBUG


connect.src=http://localhost:8544 http://localhost:8545


hibernate.connection.url=jdbc:postgresql://localhost:5432/okr
hibernate.connection.url=jdbc:postgresql://okr-dev-db:5432/okr
hibernate.connection.username=user
hibernate.connection.password=pwd
hibernate.multiTenancy=SCHEMA
Expand All @@ -19,7 +16,7 @@ okr.datasource.driver-class-name=org.postgresql.Driver
okr.user.champion.usernames=peggimann

# pitc
okr.tenants.pitc.datasource.url=jdbc:postgresql://localhost:5432/okr
okr.tenants.pitc.datasource.url=jdbc:postgresql://okr-dev-db:5432/okr
okr.tenants.pitc.datasource.username=user
okr.tenants.pitc.datasource.password=pwd
okr.tenants.pitc.datasource.schema=okr_pitc
Expand All @@ -30,7 +27,7 @@ okr.tenants.pitc.security.oauth2.frontend.client-id=pitc_okr_staging


# acme
okr.tenants.acme.datasource.url=jdbc:postgresql://localhost:5432/okr
okr.tenants.acme.datasource.url=jdbc:postgresql://okr-dev-db:5432/okr
okr.tenants.acme.datasource.username=user
okr.tenants.acme.datasource.password=pwd
okr.tenants.acme.datasource.schema=okr_acme
Expand Down
46 changes: 10 additions & 36 deletions docker/dev-with-prod/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,34 @@ include:
- ../docker-compose.yml
services:
spring:
tty: true
container_name: spring
build:
context: .
dockerfile: local-prod.Dockerfile
restart: always
environment:
SPRING_PROFILES_ACTIVE: dev
SPRING_PROFILES_ACTIVE: staging
LOGGING_LEVEL_ORG_SPRINGFRAMEWORK: debug
SPRING_FLYWAY_LOCATION: classpath:db/migration,classpath:db/data-migration,classpath:db/callback
volumes:
- ../../../okr/backend/target:/app-root/backend
network_mode: "host"
depends_on:
maven-init:
condition: service_completed_successfully

maven:
tty: true
container_name: maven
restart: on-failure
image: maven:3.9.9-amazoncorretto-21
command: mvn fizzed-watcher:run
command: sh -c "mvn fizzed-watcher:run"
working_dir: /app-root/
volumes:
- ../../../okr:/app-root
- ../../../okr:/app-root/
- ~/.m2/repository:/root/.m2/repository
depends_on:
maven-init:
condition: service_completed_successfully

maven-init:
tty: true
container_name: maven-init
image: maven:3.9.9-amazoncorretto-21
command: mvn -B clean package -P build-for-docker,debug,no-formatter
working_dir: /app-root/
volumes:
- ../../../okr:/app-root
- ~/.m2/repository:/root/.m2/repository
depends_on:
angular:
condition: service_healthy

angular:
container_name: angular
image: node:20
tty: true
restart: on-failure
image: node:22
user: "${UID:-1000}:${GID:-1000}"
volumes:
- ../../../okr:/opt
command: [ "/bin/bash", "-c", "cd /opt/frontend && rm -rf dist && npm ci && npm run watch:prod" ]
healthcheck:
test: bash -c "[ -f /opt/frontend/dist/frontend/index.html ]"
interval: 10s
retries: 999
start_period: 30s
timeout: 10s

- /etc/passwd:/etc/passwd:ro
- /etc/group:/etc/group:ro
command: [ "/bin/bash", "-c", "cd /opt/frontend && npm ci && npm run watch:prod" ]

0 comments on commit 2dbbd62

Please sign in to comment.