MitchTalmadge / AMP-dockerized

CubeCoders AMP in a Docker Image. Easily create game servers for games like Minecraft, GMod, TF2, Factorio, and StarBound!
https://hub.docker.com/r/mitchtalmadge/amp-dockerized
Other
91 stars 22 forks source link

Not possible to run behind traefik? #145

Open Choque opened 1 year ago

Choque commented 1 year ago

Hi, I'm trying to get the ADS running behind traefik but for some reason it won't work. Here's my docker-compose.yml:

version: "3"
services:
  amp:
    image: mitchtalmadge/amp-dockerized:latest
    container_name: amp
    restart: unless-stopped
    mac_address: ${MAC}
    networks:
      - proxy
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./ampdata:/home/amp/.ampdata
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
      - LICENCE=${LICENCE}
      - MODULE=ADS
    restart: unless-stopped
    labels:
      - traefik.enable=true
      - traefik.docker.network=proxy
      - traefik.http.routers.amp-secure.entrypoints=websecure
      - traefik.http.routers.amp-secure.rule=Host(`${FQDN}`)
      - traefik.http.routers.amp-secure.middlewares=safe-ipwhitelist@file
      - traefik.http.routers.amp-secure.service=amp
      - traefik.http.services.amp.loadbalancer.server.port=8080

networks:
  proxy:
    external: true

I'm running over 40 containers behind traefik, so the labels are correct and I assume the problem is with the port. I shouldn't need anything else besides 8080 for the Application Deployment Service to work, right?

When when I try to access the webinterface by calling the defined URL, for example amp.mydomain.com, I'm getting a "Bad Gateway" error.

Here's the log from the docker container:

amp  | ----------------------
amp  | Starting AMP-Dockerized...
amp  | ----------------------
amp  | Note: This is an UNOFFICIAL IMAGE for CubeCoders AMP. This was created by the community, NOT CubeCoders.
amp  | Please, DO NOT contact CubeCoders (Discord or otherwise) for technical support when using this image.
amp  | They do not support nor endorse this image and will not help you.
amp  | Instead, please direct support requests to https://github.com/MitchTalmadge/AMP-dockerized/issues.
amp  | We are happy to help you there!
amp  | Thank you!!
amp  | ----------------------
amp  |
amp  | Copying AMP Core...
amp  | Ensuring AMP user exists...
amp  | Adding group `amp' (GID 1000) ...
amp  | Done.
amp  | Adding system user `amp' (UID 1000) ...
amp  | Adding new user `amp' (UID 1000) with group `amp' ...
amp  | Not creating home directory `/home/amp'.
amp  | Ensuring correct file permissions...
amp  | Setting timezone from TZ env var...
amp  |
amp  | Current default time zone: 'Europe/Berlin'
amp  | Local time is now:      Mon Jan  9 21:20:30 CET 2023.
amp  | Universal Time is now:  Mon Jan  9 20:20:30 UTC 2023.
amp  |
amp  | /opt/entrypoint/main.sh: line 61: [: =: unary operator expected
amp  | Making sure Main instance exists...
amp  | Creating Main instance... (This can take a while)
amp  | [Info] AMP Instance Manager v2.4.1.2 built 21/12/2022 17:55
amp  | [Info] Release spec: Release - built by CUBECODERS/buildbot on CCL-DEV
amp  | [Info] Testing internet connection...
amp  | [Info] Checking licence key...
amp  | [Info] This licence key does not exist.
amp  | Setting all instances to use MainLine updates...
amp  | Upgrading Instances...
amp  | [Info] AMP Instance Manager v2.4.1.2 built 21/12/2022 17:55
amp  | [Info] Release spec: Release - built by CUBECODERS/buildbot on CCL-DEV
amp  | [Info] There are no instances to update.
amp  | Ensuring Main Instance will Start on Boot...
amp  | Starting AMP...
amp  | [Info] AMP Instance Manager v2.4.1.2 built 21/12/2022 17:55
amp  | [Info] Release spec: Release - built by CUBECODERS/buildbot on CCL-DEV
amp  | [Info] No AMP instances are currently set to start automatically on boot.
amp  | AMP Started.
amp  | ----------------------
amp  | NOTICE: Java 17 is now the default in this image. Java 16 has been removed in preference of Java 17, which is LTS.
amp  | Use the Java Configuration section in the AMP Web UI to select a specific version. Otherwise, Java 17 will be used automatically.
amp  | ----------------------
amp  | Entrypoint Sleeping. Logs can be viewed through AMP web UI or at ampdata/instances/Main/AMP_Logs

Note, I don't have a valid licence yet but the people on the CubeCoders discord assured me, that the ADS would work without a valid licence.