The application is based on Servlets, JSP, JDBC, HTML + CSS and LOG4J as a logging system. The code is covered with unit tests using JUnit and Mockito.
The application requires:
- JDK 1.8 or above;
- Maven 3.3.9 or above;
- Docker 17.05.0.
For running docker
command in UNIX / Linux operating system you may need sudo
.
Perform the next commands from the root folder of the project step by step:
-
Build docker image for database
docker build -t blog:blog-db -f Dockerfile.db .
-
Run the database
docker run -p 5432:5432 -e POSTGRES_USER=blog -e POSTGRES_PASSWORD=blog -e POSTGRES_DB=blog --name blog_db blog:blog-db
The following commands must be performed in separate terminal session.
-
Build war-archive with the application
mvn clean package
-
Build web-server image
docker build -t blog:blog-web -f Dockerfile.web .
-
Run the web server with the application
docker run -it --rm -p 8080:8080 --name blog_web --link blog_db blog:blog-web
Main page of the application
Post page
Create a new post
Edit page