Skip to content

Commit

Permalink
add heroku files and instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
ecostanzi committed May 16, 2023
1 parent 9ca048f commit 10394c3
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: java -jar target/twelve-factor-demo.jar
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# 12 Factor Demo Deployment guide

## Java
## Java fat jar

Download the jar from the [releases](/releases) page.

Create a configuration file (`config/application.properties`) with the following content

```
SERVER_PORT=8080
PORT=8080
CUSTOM_MESSAGE="Hello World From Configs"
# use the endpoint if you are using minio
Expand All @@ -31,6 +31,21 @@ Run the application
java -jar 12-factor-app.jar
```

## Heroku

```
heroku create
git push heroku master
heroku config:set CUSTOM_MESSAGE="Hello World From Heroku"
heroku config:set AWS_REGION="eu-south-1"
heroku config:set AWS_ACCESS_KEY=""
heroku config:set AWS_SECRET_KEY=""
heroku config:set AWS_BUCKET="twelve-factor-demo"
```


## Docker Compose

Run the entire app using docker compose
Expand Down
2 changes: 1 addition & 1 deletion src/main/docker/12-factor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
12-factor-demo:
image: intesys/twelve-factor-app:latest
environment:
- SERVER_PORT=8080
- PORT=8080
- CUSTOM_MESSAGE=Hello World From Docker
- AWS_ENDPOINT=http://minio:9000
- AWS_ACCESS_KEY=myuser
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static void main(String[] args) {
}

// start web server
var serverPort = Configs.getIntegerProperty("SERVER_PORT");
var serverPort = Configs.getIntegerProperty("PORT");
Javalin app = Javalin.create()
.start(serverPort);

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SERVER_PORT=8080
PORT=8080
CUSTOM_MESSAGE="Hello World From Configs"

# use the endpoint if you are using minio
Expand Down
1 change: 1 addition & 0 deletions system.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
java.runtime.version=17

0 comments on commit 10394c3

Please sign in to comment.