0

I try to start Concourse CI with custom docker-compose

version: '2'
services:
    concourse-web:
        image: concourse/concourse
        container_name: concourse-web
        command: web
        network_mode: host
        volumes: ["./keys/web:/concourse-keys"]
        environment:
            CONCOURSE_BASIC_AUTH_USERNAME: concourse
            CONCOURSE_BASIC_AUTH_PASSWORD: changeme
            CONCOURSE_EXTERNAL_URL: http://my.internal.ip:8092
            CONCOURSE_BIND_PORT: 8092
            CONCOURSE_POSTGRES_DATA_SOURCE: |-
                postgres://odoo:odoo@localhost:5432/concourse?sslmode=disable

    concourse-worker:
        image: concourse/concourse
        container_name: concourse-worker
        network_mode: host
        privileged: true
        command: worker
        volumes: ["./keys/worker:/concourse-keys"]
        environment:
            CONCOURSE_BIND_PORT: 8092

And worker can't connect to web part. Can you please help me with this.

P.S. Database postgtresql started on 5432 port on host machine, and with connection all right.

Worker errors:

{"timestamp":"1487953300.400844336","source":"tsa","message":"tsa.connection.channel.forward-worker.register.failed-to-fetch-containers","log_level":2,"data":{"error":"invalid character '\u003c' looking for beginning of value","remote":"127.0.0.1:57960","session":"4.1.1.582"}}
SirEdvin
  • 21
  • 2

2 Answers2

0

You need to set CONCOURSE_TSA_HOST: concourse-web on the worker as environment variable so that it knows which host to connect to. Right now it is trying to connect to the web part on localhost, but that is incorrect.

Another issue with your configuration is that you're trying to connect to Postgres through localhost: CONCOURSE_POSTGRES_DATA_SOURCE: |- postgres://odoo:odoo@localhost:5432/concourse?sslmode=disable, but your Postgres instance is running on the host machine. The host machine is not available on localhost inside a docker container as a docker container has it's own private network. It should instead be:

CONCOURSE_POSTGRES_DATA_SOURCE: |- postgres://odoo:odoo@my.internal.ip:5432/concourse?sslmode=disable

Mobrockers
  • 2,128
  • 1
  • 16
  • 28
-1

|- postgres://odoo:odoo@localhost:5432/concourse?sslmode=disable

should have that entire prefix removed. Replace with

CONCOURSE_POSTGRES_DATA_SOURCE: postgres://odoo:odoo@localhost:5432/concourse?sslmode=disable

materialdesigner
  • 1,492
  • 10
  • 13