This is the REST API for the ketchup system. It acts as a backend for the KetchupDesktop pomodoro timer and KetchupDashboard panel.
To enable the application to connect to a database
create an application.properties
file under
src/main/resources/
Set the first line to spring.profiles.active=base
and specify the datasource credentials for the following properties:
spring.datasource.url
spring.datasource.username
spring.datasource.password
Run the main method in class app.Application
.
Program argument --port=<some-port>
may be supplied to override the default
port specified in application-base.properties.
More information about the subject can be found
here.
Package the project according to packaging.
Run with java -jar KetchupAPI-<version-number>.jar
Run the gradle task bootRun
.
Package the project according to packaging.
Build image with docker build -t <image-name> .
from the project root.
Run docker run <image-name>
.
Options can be added after run
.
To redirect the port, use the option -p hostPort:containerPort
where containerPort is set to 8080 in the Dockerfile.
To detach container from terminal use the option -d
.
If the container does not stop on ctrl+c
, run docker ps
and docker stop <CONTAINER ID>
.
To package jar
, run gradle task gradle bootRepackage
.
The output is available under the /build/libs/
directory.