Skip to content

Commit

Permalink
fill in readme and added docker compose file
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonin Stoklasek committed Feb 18, 2017
1 parent c765691 commit a935aaf
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
## Wildfly application server with PostgreSQL database driver

docker build -t tonda100/wildfly-postgresql .
This image contains Wildfly 10.1 server with PostgreSQL database driver. The project inherits from [tonda100/wildfly-empty](https://github.com/tonda100/wildfly-empty) project. At the build time or start you have to setup these enviroment variables
* DB_HOST - hostname or IP address of database
* DB_PORT - port of database
* DB_NAME - name of the database
* DB_USER - username used for connection to database
* DB_PASS - password user for connection to database
The connection string is then created as `jdbc:postgresql://$DB_HOST:$DB_PORT/$DB_NAME` more details see [startWithPostgres.sh](https://github.com/tonda100/wildfly-postgresql/blob/master/startWithPostgres.sh)

docker run -d --name postgres -p 5432:5432 --net=wildfly -e POSTGRES_USER=myapp -e POSTGRES_PASSWORD=my-password postgres:9.6.1
### Test
Project can be tested with separate containers or via docker-compose.
`docker network create wildfly`
`docker run -d --name postgres -p 5432:5432 --net=wildfly -e POSTGRES_USER=myapp -e POSTGRES_PASSWORD=my-password postgres:9.6.1`
`docker run -d --name wildfly -p 8080:8080 --net=wildfly -e DB_HOST=postgres -e DB_NAME=myapp -e DB_USER=myapp -e DB_PASS=my-password tonda100/wildfly-postgresql`

docker run -d --name wildfly -p 8080:8080 --net=wildfly -e DB_HOST=postgres -e DB_USER=myapp -e DB_USER=myapp -e DB_PASS=my-password tonda100/wildfly-postgresql
Project is available on [GitHub](https://github.com/tonda100/wildfly-postgresql)
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '2'
services:
postgres:
image: postgres:9.6.1
ports:
- "5432:5432"
environment:
- POSTGRES_USER=myapp
- POSTGRES_PASSWORD=my-password
wildfly:
image: tonda100/wildfly-postgresql
ports:
- "8080:8080"
environment:
- DB_HOST=postgres
- DB_NAME=myapp
- DB_USER=myapp
- DB_PASS=my-password
depends_on:
- postgres

0 comments on commit a935aaf

Please sign in to comment.