This project show how to run eBay FIDO UAF Demo Server inside docker container. This project makes use of Apache Tomcat 8.5 as application server and MySQL as database.
- Docker Engine 1.11 or higher
- Docker Compose 1.7.1 or higher
git clone http://github.com/emersonmello/docker-fidouafserver
cd docker-fidouafserver
docker-compose up
- Apache Tomcat's container exposes port 8000 on host machine, so to access FIDO UAF Demo Server, you shall to point to
http://host-ip-address:8000/....
.- You can find UAF Server endpoints here, i.e.:
- http://localhost:8000/fidouaf/v1/info
- http://localhost:8000/fidouaf/v1/stats
- http://localhost:8000/fidouaf/v1/history
- http://localhost:8000/fidouaf/v1/public/regRequest/johndoe
- Endpoint for whitelisting the UUID
- Endpoint for whitelisting the Facet Id
- You can find UAF Server endpoints here, i.e.:
- Use
docker ps
to discovery the container' name of MySQL- For example:
$ docker ps --format "Name: {{.Names}}" Name: dockerfidouafserver_tomcat_1 Name: dockerfidouafserver_db_1
- Execute MySQL client
- For example:
$ docker exec -it dockerfidouafserver_db_1 mysql fido -u fidouaf -pfidoUAF
If you intend to change database connection properties (i.e hostname, port, username, password, database) you should edit tomcat/context.xml file (Current MySQL container hostname is db):
<Resource name="jdbc/fidoDB" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="fidouaf"
password="fidoUAF"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://db:3306/fido"/>
and then:
- Remember to update docker-compose.yml:
docker-compose stop
docker-compose build
docker-compose up
If you intend to change the database structure (i.e. create a new table, etc.), you should put the respective SQL instructions inside of a file (i.e. mychanges.sql
) and:
- Copy
mychanges.sql
to mysql subdirectory of this docker project - Edit mysql/Dockerfile and add the line below:
ADD mychanges.sql /docker-entrypoint-initdb.d/
docker-compose stop
docker-compose build
docker-compose up
cd docker-fidouafserver
docker-compose stop
cd ..
git clone https://github.com/emersonmello/UAF.git
cd UAF
- Do your changes on FIDO UAF Demo Server code
- Build the .WAR file of
fidouaf
- you can follow Building and Running UAF Server Using Maven (CLI only) instructions - Copy the generated .WAR file (you have to rename it to fidouaf.war) to tomcat subdirectory of this docker project
cd docker-fidouafserver
docker-compose build
docker-compose up
Ps: Database properties stored in fidouaf/src/main/webapp/META-INF/context.xml are overwritten by properties present in tomcat/context.xml
From docker official documentation:
As of Docker 1.2, restart policies are the built-in Docker mechanism for restarting containers when they exit. If set, restart policies will be used when the Docker daemon starts up, as typically happens after a system boot. Restart policies will ensure that linked containers are started in the correct order.
This project uses docker-compose multiple files concept, so you need to follow these steps:
cd docker-fidouafserver
docker-compose stop
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d