App

Quiz app

While I was studying for my java SE 8 Programmer II exam, it popped into my mind:

“Let me make a small app to practice with some questions”

And so I did!

If you have idea’s for features to add, throw them in the comments!

Check out the app: here

 

Explain!

Randomly you will get a Java or Quiz exam.

The exams only have three questions. And they’re always the same. Haha. Also, 90s style 🙂

Don’t bother. It’s still a poc.

 

Docker

It runs in a docker container:

Dockerfile

FROM openjdk:8-jdk-alpine
VOLUME /tmp COPY /target/java-exam-0.0.1-SNAPSHOT.jar app.jar
EXPOSE 8090
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]

docker-compose.yml

version: '3.3'
services:
quiz:
image: nxtra/java-quiz
ports:
- 8090:8090

Docker hub

If you did not build the image yet use the following command to build and tag:

docker build -t $dockerubh_username/my_image .

If you already build the image, tag it with your username:

docker tag my_image $dockerhub_username/my_image

From the command line login to your docker hub account and provide username and password:

docker login

Push the image to your docker hub:

docker push $dockerhub_username/my_image

Login to your remote server. From the command line login to your docker hub account and pull the image:

docker login
docker pull $dockerhub_username/my_image

The image is now available on your server. You can run it with ‘docker run …’or ‘docker-compose up’ (if docker-compose.yml is present)

 Aws

As everything on this site the app runs in the cloud on an aws ec2-instance.

Java Source

Cloned and extended from https://github.com/TheDIM47/online-exam-sample

Leave a Reply

Your email address will not be published.