Simple configuration to run SchemaSpy using docker.
- Clone the
schemaspy.properties.example
and rename the copy toschemaspy.properties
. - Fill the next information with your own on the
schema.properties
.
schemaspy.t=mariadb
schemaspy.host=172.17.0.1
schemaspy.port=3306
schemaspy.db=id_pos
schemaspy.u=root
schemaspy.p=root
schemaspy.schemas=bd_name
Note: If the host is running on your PC, docker sets the host at 172.17.0.1
by default, but you can change it if not.
- Clone the
.env.example
file into.env
file. - Set the URL to download the
.jar
associated to connector of your DB type. Also, you can uncomment/comment the default that there are on.env.example
.
- Run the
start.sh
file.
sudo sh ./start.sh
- Open the
index.html
file at the output directory.
- Build the container.
docker-compose build
- Run the container.
docker-compose up
- Access to the docker container throught bash terminal.
docker exec -it schemaspy_ubuntu /bin/bash
- Run the following command.
rm -r output/* && java -Djavax.xml.accessExternalDTD=all -jar schemaspy-exec.jar -configFile schemaspy/schemaspy.properties
-
Open the
index.html
file in theoutput
directory to see the documentation. -
Optionally, you can run schema spy without enter to bash.
docker exec schemaspy_ubuntu bash -c 'rm -r output/* && java -Djavax.xml.accessExternalDTD=all -jar schemaspy-exec.jar -configFile schemaspy/schemaspy.properties'
- Schemaspy 6.1.0
- Java 8.0
- Graphviz
- Jar Connectors to DB.
- Create a json file in
src/tables/json/es
with the name of table using lower_snake_case. - Complete the json file using the schema provided.
{
"name": "name_of_the_table_using_snake_case",
"comments": "...",
"columns": [
{
"name": "...",
"type": "...",
"comments": "..."
},
...
]
}
- Go to
src/docs.xml
and at the next entry following keep the asc order.
<!ENTITY name_of_the_table_using_snake_case SYSTEM "tables/xml/es/name_of_the_table_using_snake_case.xml">
- Run the script
sudo sh ./start.sh
, or use the commands inside it. - Upload the changes in a new pull request. Check the past pull requests to use the same structure.