This repo contains a simple CRUD Rest service written in Scala 2.13. The forder UserService contains the source code of the service and docker files. You can use docker-compose.yml file for debug the service with Postgresql database. The application uses Cats Effects 3, Log4Cats, Cats.Core, Doobie, Quill.
To run this example you need following software installed:
- Docker
- Minikube (following addons needs to be enabled: default-storageclass, ingress, storage-provisioner)
- Helm
- SBT (Optionally if you aim to build scala application manually)
- Newman or Postman (Optionnally, if you want to launch postman collection)
Note: This step can be skipped as an image is already published to dockerhub.
There are two ways of building the image
- If you have SBT installed - build the native image with commands:
$ sbt assembly
$ docker build --build-arg port=8000 -t users:0.1.0 -f Dockerfile.javabuild .
- Using docker build command (staged build):
$ docker buildx build --build-arg port=8000 -t users:0.1.1 -f Dockerfile.staged .
- Download Postgresql dependency by runnnig command
helm dependency update userservice-chart
- Run command
helm install first-release userservice-chart
The database will be installed as a dependency of userservice-chart. - Esposing a service to localhost (Windows):
minikube tunnel
- Setting up an arch.homework host - please add
127.0.0.1 arch.homework
to your hosts file (C:\windows\system32\drivers\etc\hosts on Windows)
_Note: Before running tests please wait for 20-30 seconds to allow application to start
- Ensure that minikube tunnel is estabilihed ( command
minikube tunnel
) - Change directory to manifest
- Launch newman tests:
newman run Homework-Users.postman_collection.json