Skip to content

08. Docker. Docker compose

Siarhei P edited this page Jun 10, 2024 · 4 revisions

Homework Assignment 1: Docker Compose for Application Stacks

  1. Select a combination of services (e.g., web app, database) to create a multi-container application.
  2. Create a Docker Compose YAML file to define the services, networks, and volumes.
  3. Configure environment variables and dependencies between services.
  4. Run the application stack using the docker-compose up or docker compose up command.
  5. Access the application through a web browser or API client.
  6. Document the Docker Compose file structure and the steps to deploy the application stack.

Homework Assignment 2: Docker build automation (github action)

  1. Choose a programming language (e.g., Java, Go, Python) and a sample application.
  2. Write a multi-stage Dockerfile to build the application with different stages for build and runtime.
  3. Compile or package the application in the build stage.
  4. Copy the compiled application into the runtime stage and configure it to run.
  5. Build the multi-stage Docker image and run a container based on it.
  6. Push/publish image to docker hub and/or github container register.
  7. Slack notification when build failed/success with image name/tag.
  8. Document the Dockerfile structure, the build process, and the advantages of multi-stage builds.

Docker compose file and github action file add to folder 08.Docker.Docker-compose add prepare PR (Pull Request)