# Development Installation

SkillTree's skills-service is configured with smart defaults and will work out-of-the-box. The only sticky wicket is that by default SkillTree stores its data in an embedded in-memory H2 database. That data is ephemeral and will not persist between application restarts.

You can easily setup one of 3 options:

  1. Make the embedded H2 database persistent to a file
  2. Configure an external H2 database (H2 server mode)
  3. Configure PostgreSQL (would also be used in production)

The following 2 sections will provide examples using Docker and Jar-based distributions:

TIP

Please note that all of these example run in the Password Auth Mode. Please visit PKI Auth Mode if you are interested in that mode. However, definitely use the Password Auth Mode if you are not sure which mode is applicable to you.

# Docker Distribution Dev Install Examples

Run skills-service with embedded H2 database persistent to a file:

docker run --name skills-service -d -p 8080:8080 \
-e SPRING_PROPS="\
spring.datasource.url=jdbc:h2:file:/h2-db" \
skilltree/skills-service:<version>

Please note that in this example the H2 database is persisted to file in /h2-db within that container only. Removing the container will cause data loss.

Run skills-service with external H2 database:

docker run --name skills-service -d -p 8080:8080 \
-e SPRING_PROPS="\
spring.datasource.url=jdbc:h2:tcp://<host>:1521/skills,\
spring.datasource.username=<username>,\
spring.datasource.password=<password>" \
skilltree/skills-service:<version>

Run skills-service with PostgreSQL:

docker run --name skills-service -d -p 8080:8080 \
-e SPRING_PROPS="\
spring.datasource.url=jdbc:postgresql://<host>:5432/skills,\
spring.datasource.username=<username>,\
spring.datasource.password=<password>" \
skilltree/skills-service:<version>

# Jar-Based distribution development installation

Run skills-service with embedded H2 database persistent to a file:

java -jar ~/Downloads/skills-service-X.X.X.jar --spring.datasource.url=jdbc:h2:file:~/h2-db 

Run skills-service with external H2 database:

java -jar ~/Downloads/skills-service-X.X.X.jar \
--spring.datasource.url=jdbc:h2:tcp://<host>:1521/skills \
--spring.datasource.username=<username> \
--spring.datasource.password=<pass>

Run skills-service with PostgreSQL:

java -jar ~/Downloads/skills-service-X.X.X.jar \
--spring.datasource.url=jdbc:postgresql://<host>:5432/skills \
--spring.datasource.username=<username> \
--spring.datasource.password=<pass>
Last Updated: 12/13/2022, 2:52:20 PM