Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run in Docker #125

Closed
matheus-souza opened this issue Jul 28, 2017 · 9 comments
Closed

Run in Docker #125

matheus-souza opened this issue Jul 28, 2017 · 9 comments
Assignees
Milestone

Comments

@matheus-souza
Copy link

How to use Docker and passing only the data from the database?

@npetzall
Copy link
Member

Docker is just running the application in an isolated environment, it also helps control dependencies (Java, graphviz). So when you run the image(create a container) it will need to connect to the database the same way the normal Java application would.

The hub docker page has some instructions. But if you let me know what database you want to spy on. I could assist you in the commandline used and update the documentation.

@matheus-souza
Copy link
Author

It is a PostgreSQL database

@npetzall
Copy link
Member

Then the drivers are included.

So something like docker run -v "$Pwd/output:/output" schemaspy/schemaspy:snapshot [same options as you would provide for the jar except for -dp and -o]

Only tricky thing is, if you want to spy a db running locally on your computer, then you must use a public ip doesn't work with localhost or 127.0.0.1 since it will be trapped in the container unless network-mode host is used with docker.

@matheus-souza
Copy link
Author

I'm having trouble with your connection:
ERROR - Connection error:
org.postgresql.util.PSQLException: FATAL: database "mydbase" does not exist

Failed to connect to database URL [jdbc:postgresql://myserver/mydbase]

But if I connect via the terminal I have access on this basis

Command executed:

docker run -v "$Pwd/output:/output" schemaspy/schemaspy:snapshot -t pgsql -db mydbase -host myserver -port myport -u user -p password

@matheus-souza
Copy link
Author

I found the problem, because when I connect without informing the port it was able to resolve the connection

@matheus-souza
Copy link
Author

matheus-souza commented Jul 28, 2017

How can I resolve the WARN error - /output/main.js (Permission denied)?

Occurs when I run the jar

I solved creating a folder and giving 777 permission to it and using it as volume

Final command:

docker run -v $PWD/output:/output schemaspy/schemaspy:snapshot -t pgsql -db mydbase -host myserver -u myuser -p mypassword

@npetzall
Copy link
Member

The port thing is related to #109.

I've added the write-thing for the output mount to documentation on hub.docker.

Anything else you feel missing in the documentation? I want to improve it, but to me (wrote it) it seems crystal clear =)

@rafalkasa
Copy link
Member

@matheus-souza do you have any other questions ? What you think should I close this issue ?

@rafalkasa rafalkasa added this to the 6.0.0-rc2 milestone Aug 8, 2017
@matheus-souza
Copy link
Author

I think should close the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants