Skip to content

Docker image packaging of a simple Spring Boot web application for listing values from a PostgreSQL DB. Created for an optional Docker course project.

License

Notifications You must be signed in to change notification settings

g-otn/soat-challenge-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

soat-docker-challenge

Docker image packaging of a simple Spring Boot web app to list values from PostgreSQL DB. Created for an optional Docker course project.

Running

  1. Clone the project and navigate to it:
git clone https://github.com/g-otn/soat-docker-challenge.git cd soat-docker-challenge
  1. Make sure port 80 is not in use.
  2. Run Docker Compose:
docker compose up # or docker-compose up
  1. Wait for the Spring Boot app to startup.
  2. Access http://localhost/programming-languages and you should see a JSON array listing some programming languages, retrieved from the db container.

Building

To build the backend image:

  1. Open and configure the backend/ project with your Java IDE.
  2. Compile and package it using Maven.
  3. Build the Dockerfile.
    • e.g: docker buildx build -t g0tn/soat-docker-challenge-backend backend
    • Build arguments:
      arg description default
      JAR_FILE Path to packaged .jar file target/dockerchallenge-0.0.1.jar
    • Environment variables:
      env var description default
      APP_USER Internal user for running the app backend
      APP_FOLDER Working directory where the jar will be copied to /opt/app

Acknowledgments

  • Prof. Luiz Zenha and Prof. Matheus Pavani: Course teachers.
  • marcelovbcfilho: Help with Docker Compose.

About

Docker image packaging of a simple Spring Boot web application for listing values from a PostgreSQL DB. Created for an optional Docker course project.

Topics

Resources

License

Stars

Watchers

Forks