How to connect two SCS and a proxy server via a docker-compose.yml file?

How to connect two SCS and a proxy server via a docker-compose.yml file?

We have a project that we have to build two self contained systems - Persons and Projects (some groups have to implement the persons and the others implement the projects- we have to implement the person). For each there is a separate data bank and they have to exchange information with each other. That is working with no problems (I think).

We have a project that we have to build two self contained systems - Persons and Projects (some groups have to implement the persons and the others implement the projects- we have to implement the person). For each there is a separate data bank and they have to exchange information with each other. That is working with no problems (I think).

The problem arises with the docker-compose.yml file :

version: "3.1"
services:
    proxy:
        image: nginx:1.15-alpine
        ports:
          - 8080:80
        volumes:
          - ./proxy/conf/nginx.conf:/etc/nginx/nginx.conf:ro
          - ./proxy/conf/domain.conf:/etc/nginx/domain.conf:ro
        depends_on:
          - projekt
          - person
    # ========================================
    # Falls Sie das Person-SCS implementieren,
    # ├╝berschreiben Sie diesen Teil
    persondb:
        #networks:
        #   - default
        image: mysql
        expose:
          - "3306"
        environment:
          - "MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}"
          - "MYSQL_DATABASE=${MYSQL_DATABASE}"
          - "MYSQL_USER=${MYSQL_USER}"
          - "MYSQL_PASSWORD=${MYSQL_PASSWORD}"
        volumes:
          - ./data:/var/lib/mysql
    person:
        #networks:
        #   - default
        build: ./person-scs/.
        depends_on:
          - persondb
        ports:
          - "8080"
            environment:
          - "MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}"
          - "MYSQL_DATABASE=${MYSQL_DATABASE}"
          - "MYSQL_USER=${MYSQL_USER}"
    # ========================================
    # Falls Sie das Projekt-SCS implementieren,
    # ├╝berschreiben Sie diesen Teil
    projekt:
        image: hashicorp/http-echo
        command: -listen=:8080 -text="Hello from projekt"

projektdb:
    image: hashicorp/http-echo
    command: -listen=:3306 -text="I am just a dummy"
# ========================================

Don't know if it's relevant, but the Dockefile (inside the Person directory) looks like that:

FROM openjdk:8-jdk-alpine AS build
WORKDIR /app
COPY . ./
RUN ./gradlew --no-daemon --stacktrace clean bootJar

FROM openjdk:8-jre-alpine RUN apk add --no-cache bash &&
apk update WORKDIR /app

COPY --from=build /app/build/libs/*.jar app.jar

CMD java -jar app.jar

The whole proxy-part of the docker-compose was given to us by our instructor, as well as the projekt and projektdb parts (because we don't implement the project SCS).

One of the instructions was, that no port other than 8080 will be visible "from the outside" and that we have to call out Person-API via "localhost:8080/person". As of now, when I call the localhost I get a Whitelabel Error Page.

When I ignore the proxy server and implement a docker-compose inside my Person-directory (with the same Dockerfile) I have no problems seeing the localhost:8080/person page and everything works just fine.

The docker-compose file looks like that:

version: "3.1"
services:
  database:
    networks:
      - default
    image: mysql
    expose:
      - "3306"
    environment:
      - "MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}"
      - "MYSQL_DATABASE=${MYSQL_DATABASE}"
      - "MYSQL_USER=${MYSQL_USER}"
      - "MYSQL_PASSWORD=${MYSQL_PASSWORD}"
    volumes:
      - ./data:/var/lib/mysql
  web:
    networks:
      - default
    build: .
    depends_on:
      - database
    ports:
      - "8080:8080"
    environment:
      - "MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}"
      - "MYSQL_DATABASE=${MYSQL_DATABASE}"
      - "MYSQL_USER=${MYSQL_USER}"

They gave us no background in writing docker-compose files so I'm not sure what even to Google. Hope someone could give a tip.

java docker

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How to Install OpenJDK 11 on CentOS 8

What is OpenJDK? OpenJDk or Open Java Development Kit is a free, open-source framework of the Java Platform, Standard Edition (or Java SE).

Docker Explained: Docker Architecture | Docker Registries

Following the second video about Docker basics, in this video, I explain Docker architecture and explain the different building blocks of the docker engine; docker client, API, Docker Daemon. I also explain what a docker registry is and I finish the video with a demo explaining and illustrating how to use Docker hub.

Java Core (2020) | Java for beginners | Brush up your Java Skills | Get Hired

In this video we will learn about all the major concepts that come under Java Core . The course is very carefully designed and is made with keeping simplicit...

Docker Tutorial for Beginners 8 - Build and Run C++ Applications in a Docker Container

Welcome to this on Docker Tutorial for Beginners. In this video provides an Introduction on C++ development with Docker containers. So we will see How to ship C++ Programs in Docker.

WordPress in Docker. Part 1: Dockerization

This entry-level guide will tell you why and how to Dockerize your WordPress projects.