docker ls showing processes but webserver not connecting

I’m at the very last part of an assignment and for the life of me I can’t get this to work.

I need to host a website that is deployed by a gitlab cicd pipeline, needs to run tests, build and deploy all automically.

I’m hosting with digitalOcean and all my jobs succeed, in docker ps it shows the containers but when I go to the webaddress it doesn’t want to connect

I’ll give everything, so there will be some unnecessary information, but I’m just lost right now, I’ll be forever thankful if you can help me

(images are public on docker hub listed in the yml file)

Pastebin of build output: https://pastebin.com/fdGbH0e4
Pastebin of deploy output: https://pastebin.com/S2jAjTUY

.gitlab-ci.yml

variables:
  IMAGE_NAME_BACKEND: sjorsnl77/pipeline_ipsenh-backend
  IMAGE_NAME_FRONTEND: sjorsnl77/pipeline_ipsenh-frontend
  IMAGE_TAG: ipsenh-app-1.0

stages:
  - verify
  - build
  - tests
  - deploy

services:
  - docker:dind

verify_backend:
  stage: verify
  image: maven:3.9.6-amazoncorretto-17
  script:
    - cd PintAndPillageJavaBackend
    - mvn checkstyle:checkstyle
  cache:
    key: ${CI_COMMIT_REF_SLUG}-maven
    paths:
      - .m2/repository/
    policy: pull-push
  artifacts:
    when: always
    expire_in: 1 day
    paths:
      - "PintAndPillageJavaBackend/target/checkstyle-result.xml"

verify_frontend:
  stage: verify
  image: node:latest
  script:
    - cd PintAndPillageFrontend
    - npm ci
    - ./node_modules/.bin/eslint . --output-file eslint-report.txt --quiet || true
  cache:
    key: ${CI_COMMIT_REF_SLUG}-npm
    paths:
      - node_modules/
  artifacts:
    when: always
    paths:
      - "PintAndPillageFrontend/eslint-report.txt"
    expire_in: 1 day


build:
  stage: build
  image: docker
  services:
    - docker:dind
  variables:
    DOCKER_TLS_CERTDIR: "/certs"
  before_script:
    - docker login -u "$DOCKER_USER" -p "$DOCKER_PASS"
  script:
    - docker build -t $IMAGE_NAME_BACKEND:$IMAGE_TAG PintAndPillageJavaBackend
    - docker build -t $IMAGE_NAME_FRONTEND:$IMAGE_TAG PintAndPillageFrontend
    - docker push $IMAGE_NAME_BACKEND:$IMAGE_TAG
    - docker push $IMAGE_NAME_FRONTEND:$IMAGE_TAG
  cache:
    paths:
      - .m2/repository/
      - node_modules/

test_backend:
  stage: tests
  image: docker
  script:
    - docker login -u "$DOCKER_USER" -p "$DOCKER_PASS"
    - docker-compose up --build -d db backend
    - docker-compose exec backend ./mvnw test
    - docker-compose exec backend sh -c "cp -r target/surefire-reports/. /test-output/backend/"
    - docker-compose down
  artifacts:
    when: always
    paths:
      - test-output/backend/
    expire_in: 1 day

test_frontend:
  stage: tests
  image: docker
  script:
    - docker login -u "$DOCKER_USER" -p "$DOCKER_PASS"
    - docker-compose up --build -d frontend
    - docker-compose exec frontend npm run test:unit
    - docker-compose exec frontend sh -c "cp -r ./test-output/frontend/. /test-output/frontend/"
    - docker-compose down
  artifacts:
    when: always
    paths:
      - test-output/frontend/
    expire_in: 1 day

deploy_app:
  stage: deploy
  before_script:
    - chmod 400 $SSH_KEY
  script:
    - ssh -o StrictHostKeyChecking=no -i $SSH_KEY root@$IP_SERVER "
        docker login -u $DOCKER_USER -p $DOCKER_PASS;
        if [ -n "$(docker ps -aq)" ]; then 
          docker ps -aq | xargs docker stop | xargs docker rm; 
        fi;
        docker run -d -p 8080:8080 $IMAGE_NAME_BACKEND:$IMAGE_TAG;
        docker run -d -p 3000:3000 $IMAGE_NAME_FRONTEND:$IMAGE_TAG;
      "

docker-compose.yml

services:
  db:
    image: postgres:latest
    restart: always
    environment:
      POSTGRES_DB: PintAndPillage
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
    volumes:
      - postgres-data:/var/lib/postgresql/data
    ports:
      - "5432:5432"

  backend:
    build:
      context: ./PintAndPillageJavaBackend
      dockerfile: Dockerfile
    ports:
      - "8080:8080"
    depends_on:
      - db
    environment:
      SPRING_PROFILES_ACTIVE: dev
      SPRING_DATASOURCE_URL: ${DATASOURCE_URL}
      SPRING_DATASOURCE_USERNAME: ${DATASOURCE_USERNAME}
      SPRING_DATASOURCE_PASSWORD: ${DATASOURCE_PASSWORD}
      SPRING_JPA_HIBERNATE_DIALECT: ${HIBERNATE_DIALECT}
      SPRING_JPA_HIBERNATE_DDL_AUTO: ${HIBERNATE_DDL}
      SERVER_ERROR_INCLUDE_MESSAGE: always
      JWT_SECRET: ${JWT_SECRET}
    volumes:
      - ./test-output/backend:/test-output/backend


  frontend:
    build:
      context: ./PintAndPillageFrontend
      dockerfile: Dockerfile
    ports:
      - "3000:3000"
    depends_on:
      - backend
    volumes:
      - ./test-output/frontend:/test-output/frontend

volumes:
  postgres-data:

Dockerfile frontend

FROM node:14
WORKDIR /app
COPY . /app
RUN npm install
CMD ["npm", "run", "serve"]

Dockerfile backend

FROM openjdk:17
WORKDIR /app
COPY . /app
RUN chmod +x mvnw
RUN ./mvnw install
CMD ["./mvnw", "spring-boot:run"]

Even the terminal shows it (weird that the backend is now not showing, but even without the backend it should run the frontend, but you just can’t log in)
188.166.4.5:3000, 188.166.4.5:8080, 188.166.4.5. All don’t work with connecting

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật