rundeck / docker-zoo

196 stars 82 forks source link

The basic example redirects to http://127.0.0.1:4440/ #4

Closed fungiboletus closed 2 years ago

fungiboletus commented 5 years ago

Hei,

The basic example does redirect quite a few times to http://127.0.0.1:4440. Which is fine, unless you test it on a random local virtualbox VM or on a random cloud VM.

I believe adding the RUNDECK_GRAILS_URL setting would not make the example much more complex.

filviu commented 5 years ago

I added RUNDECK_GRAILS_URL to .env before doing docker-compose up but it still redirects to 127.0.0.1

rafaiovlabs commented 3 years ago

Also it seems that from the code these images are built with localhost burned, from a docker-lib addition, any idea how to overwrite this sets ? .

kevinadhiguna commented 2 years ago

I ran to this issue when using docker-compose.yml here.

To solve the problem, I added RUNDECK_GRAILS_URL: ${RUNDECK_GRAILS_URL:-localhost:4440} in environment section of docker-compose.yml. This worked but I wanted to add environment variable to handle the URL, so it looked like this :
RUNDECK_GRAILS_URL: ${RUNDECK_GRAILS_URL:-localhost:4440}

The whole docker-compose.yml is :

version: '3'

services:
    rundeck:
        image: rundeck/rundeck:SNAPSHOT
        # links:
        #   - mysql
        depends_on:
          - mysql
        environment:
            RUNDECK_DATABASE_DRIVER: org.mariadb.jdbc.Driver
            RUNDECK_DATABASE_USERNAME: ${RUNDECK_DATABASE_USERNAME:-rundeck}
            RUNDECK_DATABASE_PASSWORD: ${RUNDECK_DATABASE_PASSWORD:-rundeck}
            RUNDECK_DATABASE_URL: ${RUNDECK_DATABASE_URL:-jdbc:mysql://mysql/rundeck?autoReconnect=true&useSSL=false}
            # Add 'RUNDECK_GRAILS_URL' to avoid host changing to localhost (see more : https://github.com/rundeck/rundeck/issues/671)
            # 'RUNDECK_GRAILS_URL' can be remote IP address, such as 43.133.23.165 or hostname, like https://mywebsite.com
            RUNDECK_GRAILS_URL: ${RUNDECK_GRAILS_URL:-localhost:4440}
        # volumes:
        #   - ${RUNDECK_LICENSE_FILE:-/dev/null}:/home/rundeck/etc/rundeckpro-license.key
        ports:
          - 4440:4440
    mysql:
        image: mysql:5.7
        # expose:
        #   - 3306
        ports:
          - 3306:3306
        environment:
          MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root}
          MYSQL_DATABASE: ${MYSQL_DATABASE:-rundeck}
          MYSQL_USER: ${MYSQL_USER:-rundeck}
          MYSQL_PASSWORD: ${MYSQL_PASSWORD:-rundeck}
        volumes:
          - dbdata:/var/lib/mysql

volumes:
    dbdata:

Also, this is the .env file that includes environment variables and thier values :

RUNDECK_DATABASE_USERNAME=rundeck
RUNDECK_DATABASE_PASSWORD=rundeck
RUNDECK_DATABASE_URL=jdbc:mysql://mysql/rundeck?autoReconnect=true&useSSL=false
RUNDECK_GRAILS_URL=https://mywebsite.com
MYSQL_ROOT_PASSWORD=root
MYSQL_DATABASE=rundeck
MYSQL_USER=rundeck
MYSQL_PASSWORD=rundeck

Feel free to change the value of RUNDECK_GRAILS_URL in .env.

You can have a look here to check them all, including how to run the docker-compose and its setup :

DaiZack commented 2 years ago

This works for me

version: '3'

services: rundeck: image: rundeck/rundeck:SNAPSHOT links:

volumes: dbdata: