r3-team / r3_docker

REI3 dockerfile
MIT License
6 stars 3 forks source link

Invalid Interpolation R3_DB #6

Open phifogg opened 23 hours ago

phifogg commented 23 hours ago

Hi Team, I wanted to give REI3 a spin on my docker host. However, I cannot start the container. Here is the error message:

xxx@xxxxx:/opt/docker/rei3$ docker-compose -f docker-rei3.yml up -d 
ERROR: Invalid interpolation format for "r3_db" option in service "services": "r${R3_VERSION:-3.9.2}_db"

I tried setting the R3_VERSION environment variable to 3.9.2, same error.

My Docker-compose is v1.25.0 on a debian linux.

Thanks!

r3-gabriel commented 21 hours ago

Hello and thank you for the report.

I had a look and the current compose file works at least on my system (Docker Compose v2.29.2). It might be possible that our Docker Compose file uses features that v1.25.0 of Docker Compose does not support yet - though I cannot test it right now.

I assume you cannot upgrade to a later version of Docker Compose. If the issue is with the placeholders such as r${R3_VERSION:-3.9.2}_db, you could try to set the values directly:

phifogg commented 20 hours ago

Thanks! I had to fiddle around a bit more with the file, but finally the containers got started.

For reference:

version: "2.1"

services:
    r3_db:
        container_name: r3.9.2_db
        environment:
            POSTGRES_DB: app
            POSTGRES_USER: app
            POSTGRES_PASSWORD: app
        image: postgres:16
        restart: always
        volumes:
            - /opt/r3/postgresql:/var/lib/postgresql/data
    r3:
        build:
            context: https://github.com/r3-team/r3_docker.git#main
            args:
                r3_version: 3.9.2
                r3_db_host: r3_db
                r3_db_name: app
                r3_db_user: app
                r3_db_pass: app
                r3_os_arch: x64
                im_policy: /etc/ImageMagick-6/policy.xml
        container_name: r3.9.2_app
        image: r3:3.9.2
        depends_on:
            - r3_db
        ports:
            - "14000:80"
#        pull_policy: never
        restart: always
        volumes:
            - /opt/r3/data:/opt/r3/data
r3-gabriel commented 20 hours ago

So it seems to be related to unsupported features of the current Docker Compose file in an older version. Thank you for reporting back.

phifogg commented 19 hours ago

Also, the version tag line was missing. Not sure 2.1 is the best one :D But it worked.

r3-gabriel commented 18 hours ago

The version tag has been marked as obsolete by Docker and if you still use it in modern Docker Compose versions, you get warnings. We have just removed it a short while back.

I am happy that you got it to run, though you might want to upgrade in the future if you are able, to avoid these kinds of issues.