diff --git a/.gitignore b/.gitignore index 7f7acb32..116bf8fc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +schemaspy/schemaspy-output htmlReport/ /target /.vscode diff --git a/docker-compose.yml b/docker-compose.yml index ad97010b..90e6f70f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ services: api: profiles: - - api + - api build: context: . dockerfile: server/wfprev-api/Dockerfile.graalvm @@ -65,6 +65,33 @@ services: retries: 5 start_period: 10s + schemaspy: + profiles: + - schemaspy + build: + context: . + dockerfile: schemaspy/Dockerfile + container_name: schemaspy + depends_on: + db: + condition: service_healthy + environment: + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + command: + [ + "-t", "pgsql", + "-host", "wfprev-postgres", + "-port", "5432", + "-db", "wfprev", + "-u", "wfprev", + "-p", "${POSTGRES_PASSWORD}", + "-debug" + ] + volumes: + - ./schemaspy/schemaspy-output:/output + networks: + - wfprev-network + networks: wfprev-network: driver: bridge diff --git a/schemaspy/Dockerfile b/schemaspy/Dockerfile new file mode 100644 index 00000000..825b48a4 --- /dev/null +++ b/schemaspy/Dockerfile @@ -0,0 +1,10 @@ +FROM schemaspy/schemaspy:latest + +USER root +RUN addgroup -S schemaspy && adduser -S schemaspy -G schemaspy +RUN mkdir -p /drivers /output && chown -R schemaspy:schemaspy /drivers /output + +RUN apk update && apk add --no-cache curl +RUN curl -fSL https://jdbc.postgresql.org/download/postgresql-42.7.4.jar -o /drivers/postgresql.jar + +USER schemaspy \ No newline at end of file