Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/willis7/invader-zim
Simple spring boot application using MongoDB
https://github.com/willis7/invader-zim
Last synced: 1 day ago
JSON representation
Simple spring boot application using MongoDB
- Host: GitHub
- URL: https://github.com/willis7/invader-zim
- Owner: willis7
- Created: 2015-02-18T22:00:43.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-06-06T16:05:30.000Z (over 9 years ago)
- Last Synced: 2024-04-24T12:07:01.021Z (8 months ago)
- Language: Groovy
- Size: 223 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
Awesome Lists containing this project
README
== Demo Spring Boot Groovy app
This application demonstrates how easy it is to build a Groovy Spring Boot application, using Cucumber to test. It uses embedded server and mongo during functional tests.
==== To run tests
[source]
----
gradle clean check
----==== Set up MongoDB
Make sure that you have MongoDB installed and running. Once the `mongod` process is up and running, insert some test data into the database by running:
[source]
----
mongo invasion src/main/resources/mongo/quotes.js
----==== To run the app from Gradle using local Mongo
[source]
----
gradle run
----==== To run up the fat jar
[source]
----
java -jar build/libs/invader-zim
----== Docker
If you want the easy way of running this build simply build the microservice with `gradlew clean assemble` followed by:
==== Start a mongodb container
[source]
----
docker run -d --name zim-mongo mongo
----==== Seed the DB
The following command starts another mongo container instance and runs the mongo command line client against your original mongo container, allowing you to execute statements against your database instance:
[source]
----
docker run -it -v $PWD/docker/db/quote.js:/src/quote.js:ro --link zim-mongo:mongo --rm mongo sh -c 'exec mongo "$MONGO_PORT_27017_TCP_ADDR:$MONGO_PORT_27017_TCP_PORT/invasion" /src/quote.js'
----==== Build the Zim service image
[source]
-----
docker build -t zim-svc .
-----==== Start zim-svc container linked to zim-mongo container
[source]
----
docker run -d -p 8080:8080 --link zim-mongo:mongo --name zim-svc zim-svc
----