Quarkus, GraalVM, Svelte, Docker simple application.
After the-two-nuts-with-chocolate I decided to create simple Quarkus native application example. Backend is same like in the-two-nuts-with-chocolate, frontend is svelte sapper application.
Database implementation - Postgres
Database versioning - Flyway
Messaging platform - Kafka
gu install native-image
sudo apt-get install libz-dev
mvn clean install -Pdocker
In root directory
docker-compose up
Kafka topic is not created at first start so we have to create it:
docker exec -it the-final-nut_kafka_1 kafka-topics.sh --create --zookeeper zookeeper:2181 --replication-factor 1 --partitions 1 --topic nut
Then we have to start service:
docker container start the-final-nut_backend_1
or
docker-compose down
docker-compose up
I didn't configure any proxy. You have to add
127.0.0.1 backend
to your /etc/hosts
docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
janobono/final-nut-frontend latest c3723e6b45d0 31 seconds ago 93.2MB
janobono/final-nut-backend latest 3200130d38f9 About a minute ago 218MB
docker stats
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
5048787efe8c the-final-nut_backend_1 0.38% 33.48MiB / 7.677GiB 0.43% 15.4kB / 13.2kB 0B / 0B 16
In my opinion there is no real argument for GraalVM native build now.
debian:10-slim
was usedI didn't write any native test so this should be next effort. Memory consumption is really impressive but if you haven't resource problems the price for this result should be really big.