From 397aeaca89d56d77eaca082441e9d21a36e0e249 Mon Sep 17 00:00:00 2001 From: johnmara94 Date: Tue, 16 Feb 2021 22:56:39 +0200 Subject: [PATCH] Update deployment instructions in README --- README.md | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ba9a84c..2a8bae8 100644 --- a/README.md +++ b/README.md @@ -19,31 +19,64 @@ The application is a Web Application, written in Spring Boot with MVC pattern. For page rendering, thymeleaf is used. For persistence layer, JPA with Hibernate is used. Regarding the database, it is tested with MySQL but any Relation database should work. +# Deployment -## Deploy the application -A demo is already deployed under [Simplinvoice Demo](https://simplinvoice.eu) +## Demo environment +A demo is already deployed under [Simplinvoice Demo](https://simplinvoice.eu) +_Send me an email in order to enable you, after your registration. +In demo environment, invoices are sent to a mock endpoint._ -### System Requirements +## Local deployment + +### Manual + +#### System Requirements - Java 1.8+ - Relational Database (MySQL is recommended) -In order to run the application, run +#### Deploy +In order to create the executable, run +```bash +>mvn package +``` +Then, you need to set the following **Environment Variables**. +**Windows** +```bash +>set MYSQL_HOST=HOST:PORT +>set MYSQL_USER=YOUR_DB_USER +>set MYSQL_PASS=YOUR_DB_PASS +>set MYSQL_DB=YOUR_DB_NAME +>set AADE_MYDATA_URL=https://mydata-dev.azure-api.net ``` -java -jar simplinvoice-1.0.0.jar +**Linux** +```bash +>export MYSQL_HOST=HOST:PORT +>export MYSQL_USER=YOUR_DB_USER +>export MYSQL_PASS=YOUR_DB_PASS +>export MYSQL_DB=YOUR_DB_NAME +>export AADE_MYDATA_URL=https://mydata-dev.azure-api.net ``` +In order to run the application, run +```bash +>java -jar simplinvoice-X.X.X.jar +``` +Application will be reachable at `http://localhost:8080`. +You can also register it as windows or linux service in order to run it as daemon. -#### Docker +### Docker You can also deploy the application with a Docker container. You can use [this](Dockerfile) Dockerfile to build the image and then run -``` +```bash docker build -t IMAGE_NAME . docker run --name CONTAINER_NAME -p 8480:8080 \ -e MYSQL_HOST='HOST:PORT' \ -e MYSQL_USER='YOUR_DB_USER' \ -e MYSQL_PASS='YOUR_DB_PASS' \ -e MYSQL_DB='YOUR_DB_NAME' \ +-e AADE_MYDATA_URL='https://mydata-dev.azure-api.net' \ -d IMAGE_NAME ``` +Application will be reachable at `http://localhost:8480`. ## Contribute You can fork the project and start working with any open issue which is available here [Simplinvoice Open Issues](https://github.com/johnmara/simplinvoice/issues)