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.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

WordPress in Docker. Part 1: Dockerization

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

Dockerize Java App

In this article, we'll provide a brief introduction to Docker and go over what it takes to containerize a Java application.

List all containers in Docker(Docker command)

We can get a list of all containers in docker using `docker container list` or `docker ps` commands.