fix(backend): Add postgres run configuration for persistent database
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -57,3 +57,6 @@ bin/
|
|||||||
### OpenAPI ###
|
### OpenAPI ###
|
||||||
legalconsenthub/.api-client
|
legalconsenthub/.api-client
|
||||||
legalconsenthub/.api-client-middleware
|
legalconsenthub/.api-client-middleware
|
||||||
|
|
||||||
|
### PostgreSQL persistent data ###
|
||||||
|
legalconsenthub-backend/postgres-data/
|
||||||
|
|||||||
13
.run/local-server-backend-postgres.run.xml
Normal file
13
.run/local-server-backend-postgres.run.xml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="local-server-backend-postgres" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
|
||||||
|
<option name="ACTIVE_PROFILES" value="postgres" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH" value="ms-21" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
|
||||||
|
<module name="com.betriebsratkanzlei.legalconsenthub.main" />
|
||||||
|
<option name="SPRING_BOOT_MAIN_CLASS" value="com.betriebsratkanzlei.legalconsenthub.LegalconsenthubApplication" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/legalconsenthub-backend" />
|
||||||
|
<method v="2">
|
||||||
|
<option name="Make" enabled="true" />
|
||||||
|
</method>
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
13
.run/local-server-backend-testcontainers.run.xml
Normal file
13
.run/local-server-backend-testcontainers.run.xml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="local-server-backend-testcontainers" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
|
||||||
|
<option name="ACTIVE_PROFILES" value="testcontainers" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH" value="ms-21" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
|
||||||
|
<module name="com.betriebsratkanzlei.legalconsenthub.main" />
|
||||||
|
<option name="SPRING_BOOT_MAIN_CLASS" value="com.betriebsratkanzlei.legalconsenthub.LegalconsenthubApplication" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/legalconsenthub-backend" />
|
||||||
|
<method v="2">
|
||||||
|
<option name="Make" enabled="true" />
|
||||||
|
</method>
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
20
legalconsenthub-backend/docker-compose.yml
Normal file
20
legalconsenthub-backend/docker-compose.yml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:17-alpine
|
||||||
|
container_name: legalconsenthub-postgres
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: legalconsenthub
|
||||||
|
POSTGRES_USER: legalconsenthub
|
||||||
|
POSTGRES_PASSWORD: legalconsenthub
|
||||||
|
ports:
|
||||||
|
- "5432:5432"
|
||||||
|
volumes:
|
||||||
|
- ./postgres-data:/var/lib/postgresql/data
|
||||||
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U legalconsenthub -d legalconsenthub"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: legalconsenthub
|
||||||
|
|
||||||
|
datasource:
|
||||||
|
hikari:
|
||||||
|
auto-commit: false
|
||||||
|
url: jdbc:postgresql://localhost:5432/legalconsenthub
|
||||||
|
username: legalconsenthub
|
||||||
|
password: legalconsenthub
|
||||||
|
driver-class-name: org.postgresql.Driver
|
||||||
|
|
||||||
|
jpa:
|
||||||
|
database-platform: org.hibernate.dialect.PostgreSQLDialect
|
||||||
|
hibernate:
|
||||||
|
ddl-auto: validate
|
||||||
|
show-sql: true
|
||||||
|
properties:
|
||||||
|
hibernate:
|
||||||
|
format_sql: true
|
||||||
|
jdbc:
|
||||||
|
batch_size: 100
|
||||||
|
order_inserts: true
|
||||||
|
enable_lazy_load_no_trans: true
|
||||||
|
|
||||||
|
liquibase:
|
||||||
|
enabled: true
|
||||||
|
drop-first: false
|
||||||
|
change-log: classpath:/db/changelog/db.changelog-master.yaml
|
||||||
|
default-schema: public
|
||||||
|
|
||||||
|
sql:
|
||||||
|
init:
|
||||||
|
platform: postgresql
|
||||||
|
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
org:
|
||||||
|
springframework:
|
||||||
|
security: TRACE
|
||||||
|
oauth2: TRACE
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
testcontainers.reuse.enable=true
|
||||||
Reference in New Issue
Block a user