Backend API for homepage (https://tomlin.no) and possible other projects.
API, Spring, Spring Boot, REST, Kotlin, Gradle, OkHttp, Nginx, MySQL
./gradlew build
java -jar build/libs/tomlin-api-1.0.0.jar --spring.profiles.active=prod
-Dspring.profiles.active=prod
./gradlew dependencyUpdates
Move files under service
directory to /etc/systemd/system/
sudo mv tomlin-api* /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable tomlin-api && sudo systemctl start tomlin-api
sudo systemctl enable tomlin-api-watcher && sudo systemctl start tomlin-api-watcher
sudo systemctl enable tomlin-api-watcher.path && sudo systemctl start tomlin-api-watcher.path
sudo apt install certbot python-certbot-nginx
sudo certbot --nginx
sudo certbot renew [--dry-run]
sudo nano /etc/nginx/sites-available/default
sudo nginx -t
sudo systemctl restart nginx
Proxy configuration:
location / {
proxy_pass http://localhost:8081/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
}
sudo apt install mariadb-server
mysql_secure_installation
mysql -u root -p
sudo apt update
sudo apt uprgade
sudo apt install openjdk-17-jdk
sudo apt install mariadb-server
sudo mariadb-secure-installation
mysql -u root -p
mysql -u root -p database_name < backup.sql
sudo apt install nginx
chmod +x tomlin-api-1.0.0.jar