Vote counter
Development
Please remember to update application.conf.template when adding new configurable properties.
Deployment
Configuration
-
Create a keystore under
src/main/resources
with an RSA key, note down the keystore password you pick.keytool -genkey -alias '*' -keystore src/main/resources/keystore.jks -keyalg RSA -keysize 2048 -sigalg "SHA1withRSA"
-
Create an
application.conf
file based on the template.NOTE: if you pick a name other than
application.conf
for your config file, be sure to update the Dockerfile accordingly if you plan on using the Docker image. -
Set the
vote-counter.web.keystore-password
to the keystore password you chose in step 1.
Running
-
Build the fat JAR:
sbt assembly
-
Run the JAR manually or use the Docker image. The server listens on
8080
for HTTP and on8090
for HTTPS requests.
If the devices are configured to send heartbeats, you can view the status of the devices under the /status
URL (or see the raw JSON data at /heartbeats
).
Running manually
java -cp java -cp target/scala-2.11/vote-counter-assembly-1.0.jar -Dconfig.file=application.conf com.softwaremill.votecounter.web.VoteCounterWeb
Docker image
Running using the-
Build the image:
docker build -t softwaremill/vote-counter .
-
Run the image in detached mode with port forwarding enabled:
docker run -d -P softwaremill/vote-counter