Skip to content

Commit d6ab26f

Browse files
authored
fix!: create /app/data dir and give appuser permissions (#14)
Co-authored-by: Vladyslav Pasichniuk <vladyslav_pasichniuk@epam.com>
1 parent a601d0c commit d6ab26f

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ FROM eclipse-temurin:17-jre-alpine AS runtime
1717
WORKDIR /app
1818

1919
RUN adduser -u 1001 --disabled-password --gecos "" appuser && \
20-
chown appuser:appuser /app
20+
mkdir -p /app/data && \
21+
chown -R appuser:appuser /app
2122

2223
COPY --from=builder --chown=appuser:appuser /build-workspace/build/libs/ai-dial-admin-backend*.jar ./app.jar
2324

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ config.export.keyvault.type=vault
150150
| datasource.vendor | DATASOURCE_VENDOR | H2 | Datasource vendor: <ul><li>H2</li><li>POSTGRES</li><li>MS_SQL_SERVER</li></ul> |
151151
| datasource.auth.type | DATASOURCE_AUTH_TYPE | basic | Datasource auth type: <ul><li>basic (username and password)</li><li>azure (see [Azure Configuration](#azure-configuration): azure.auth.type)</li></ul> |
152152
| h2.datasource.url | H2_DATASOURCE_URL | - | JDBC URL for H2 database connection |
153-
| | H2_FILE | ./testdb | H2 database file |
153+
| | H2_FILE | ./data/testdb | H2 database file |
154154
| | H2_OPS | CIPHER=AES;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE | H2 database connection options |
155155
| h2.datasource.masterKey | H2_DATASOURCE_MASTERKEY | - | Master key for H2 database encryption |
156156
| h2.datasource.encryptedFileKey | H2_DATASOURCE_ENCRYPTEDFILEKEY | - | Encrypted file key for H2 database |

local_env/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ services:
1717
METRICS_STORAGE_TOKEN: "myadmintoken"
1818
CORE_CLIENT_URL: "http://core:8080"
1919
DISABLE_SWAGGER_AUTHORIZATION: true
20+
H2_FILE: ./data/testdb
2021
H2_DATASOURCE_MASTER_KEY: t8+npcgNMiipR+kHMb8zXAjgA3IedCXC
2122
H2_DATASOURCE_ENCRYPTED_FILE_KEY: 9vW1l/Eg+1J3YXpCsyR6AUI4ptMtI6pjkktePuUQts+wKVAauoP5CG21z5WTzp91xBcEww==
2223
H2_DATASOURCE_PASSWORD: password

src/main/resources/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ management.server.port=9464
9494
datasource.vendor=${DATASOURCE_VENDOR:H2}
9595
datasource.auth.type=${DATASOURCE_AUTH_TYPE:basic}
9696

97-
h2.datasource.url=jdbc:h2:file:${H2_FILE:./testdb};${H2_OPS:CIPHER=AES;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE}
97+
h2.datasource.url=jdbc:h2:file:${H2_FILE:./data/testdb};${H2_OPS:CIPHER=AES;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE}
9898
h2.datasource.driver-class-name=org.h2.Driver
9999
h2.datasource.username=sa
100100
h2.datasource.masterKey=${H2_DATASOURCE_MASTER_KEY}

0 commit comments

Comments
 (0)