Skip to content

Commit

Permalink
Fix new version to deploy it
Browse files Browse the repository at this point in the history
  • Loading branch information
acheype committed Feb 25, 2018
1 parent d2faa06 commit 01917de
Show file tree
Hide file tree
Showing 6 changed files with 382 additions and 323 deletions.
59 changes: 40 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

### The database of medicinal plants against malaria

Malaria Plant DB was generated using JHipster, you can find documentation and help at [JHipster][].
## JHipster
Malaria Plant DB was generated using the JHipster v2.23 stack, you can find documentation and help at this
[JHipster archive documentation][http://www.jhipster.tech/documentation-archive/v2.23.0/].

Before you can build this project, you must install and configure the following dependencies on your machine:

Expand All @@ -28,7 +30,7 @@ Bower is used to manage CSS and JavaScript dependencies used in this application
specifying a newer version in `bower.json`. You can also run `bower update` and `bower install` to manage dependencies.
Add the `-h` flag on any command to see how you can use it. For example, `bower update -h`.

# Building for production
## Building for production

To optimize the malariaplantdb client for production, run:

Expand All @@ -43,12 +45,35 @@ To ensure everything worked, run:

Then navigate to [http://localhost:8080](http://localhost:8080) in your browser.

[JHipster]: https://jhipster.gitub.io/
[Node.js]: https://nodejs.org/
[Bower]: http://bower.io/
[Grunt]: http://gruntjs.com/
[BrowserSync]: http://www.browsersync.io/
## Use in development

You need both a [PostgreSQL][] server and an [Elasticsearch][] engine to run the web server.

To have the database and elasticsearch set quicky, it's possible to use the same docker image than in production. For
this, you can go to the directory `docker/test` and launch separately the two services :

docker-compose up postgres
docker-compose up elasticsearch

Then, to launch the web server you can use the maven plugin by taping :

mvn spring-boot:run

But the quicker is to use you IDE to launch the `nc.ird.malariaplantdb.Application` main class. By default, the `dev`
profile is set. You speed up the startup, you can also add the `fast` profile (`--spring.profiles.active=dev,fast` in a
command line).

If the database schema is not created, the web application will init it at startup. However, it will not the case with
the `fast` profile activated. So think about to disable it, the first time you start the web application.

To keep you web navigator synchronized with the last version on the web client, you can use the [BrowserSync][] facility
by launching :

grunt serve

Then you will need to connect you at the web application by a different port : http://localhost:3000

## From development to production

mvn -Pprod clean package
cp target/malariaplantdb-1.0.war docker/test/malariaplantdb-web/malariaplantdb.war
Expand All @@ -59,15 +84,11 @@ Then navigate to [http://localhost:8080](http://localhost:8080) in your browser.
mkdir /data/postgres -R
mkdir /data/es-data
sudo chown 999:999 /data/es-data/



## From development to production

To have the database and elasticsearch set quicky, it's possible to use the same docker image than in production. For
this, you can go to the directory `docker/test` and launch separately the two services :

docker-compose up postgres
docker-compose up elasticsearch



[JHipster]: https://jhipster.gitub.io/
[Node.js]: https://nodejs.org/
[Bower]: http://bower.io/
[Grunt]: http://gruntjs.com/
[BrowserSync]: http://www.browsersync.io/
[PostgreSQL]: https://www.postgresql.org/
[Elasticsearch]: https://www.elastic.co/
2 changes: 1 addition & 1 deletion docker/prod/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'
services:
springboot-app:
container_name: malariaplantdb-web
image: acheype/malariaplantdb-web:0.9.1
image: acheype/malariaplantdb-web:0.9.2
ports:
- "80:80"
links:
Expand Down
Loading

0 comments on commit 01917de

Please sign in to comment.