A5 Repo for CS6310 Fall 2021 Group 90
https://docs.docker.com/get-docker/
- Docker installed
- Maven installed (to implement and run locally)
In a terminal window, run:
mvn clean package
The above command will:
- Clean maven dependencies and compiled sources
- Generate a Jar with all executables and dependencies
- The above jar should contain the same files which are containerized with Docker, in order to see the contents in the Jar run:
jar xf <package.jar>
- The above jar should contain the same files which are containerized with Docker, in order to see the contents in the Jar run:
- Make sure Docker is running locally
- In a terminal window (located in the same directory of the Dockerfile and docker-compose.yml) run:
docker-compose build
docker-compose run app-server
- Notes:
- In some occasions, the database container will not execute changes done in either the sql/create_tables.sql or sql/fill_tables.sql. This could be that the previous container's volume is still present, and docker will not replace it. In this situation, try running:
docker-compose down
docker volume rm <volume_name>
docker-compose up --build -d
docker-compose run database
(in one terminal - this process could be killed after succeeded)docker-compose run app-server
(in another terminal)
- In some occasions, the database container will not execute changes done in either the sql/create_tables.sql or sql/fill_tables.sql. This could be that the previous container's volume is still present, and docker will not replace it. In this situation, try running:
- Simply stop the command with Ctrl+C or Ctrl+D
- Once stopped, consider running
docker-compose down
to be safe the every thing is stopped correctly
docker-compose ps
or
docker ps
- Verify the postgres container is running
- Run
docker exec -it <postgres_container_id> bash
- Once in the container, run:
psql -U postgres
- To see all tables, run
\d
- Make any desired CRUD operation, i.e
SELECT * FROM table