-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fill in readme and added docker compose file
- Loading branch information
Antonin Stoklasek
committed
Feb 18, 2017
1 parent
c765691
commit a935aaf
Showing
2 changed files
with
34 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |