Call Baserow API inside docker container

Please fill in the questionnaire below.

Technical Help Questionnaire

Have you read and followed the instructions at: *READ ME FIRST* Technical Help FAQs - #2 by nigel ?

Answer: Yes, i did

How have you self-hosted Baserow.

Docker

What are the specs of the service or server you are using to host Baserow.

locally, Core I5, 16GB RAM, Docker

Which version of Baserow are you using.

1.23.2

I’m developing a CRUD application with DJANGO using BASEROW as database manager. Both resources are running on Docker container. I can call BASEWROW API request outside from container using ‘localhost’ (JWT and TOKEN), but i need call requests inside Django application (view) to display tables in templates (show and update tables), but the baserow just return html for GET call, ignoring token.

Below, i show the docker compose file:

I’m using just one Postgres database to simplify the development, but the Oracle database will be connected as Baserow database host.

version: ‘3.5’
services:

    db:
            image: postgres
            volumes:
             - postgres_data:/var/lib/postgresql/data/
            environment:
            - POSTGRES_DB=baserow
            - POSTGRES_USER=postgres
            - POSTGRES_PASSWORD=postgres
            - POSTGRES_HOST_AUTH_METHOD=trust

            ports:
              - "5432:5432"

            command: -p 5432  

            networks:
            - local 

            healthcheck:
              test:    [ "CMD-SHELL", "[ -r /var/run/postgresql_table/ready ] || ( pg_isready && touch /var/run/postgresql_table/ready)" ]

    web:
            image: tjrj
            build: .
            command: python3 /temp/manage.py runserver 0.0.0.0:8030
            volumes:
                    - .:/temp
            ports:
                    - 8030:8030

            environment:
              PUBLIC_DNS: domain
              ORGANISATION_UNIT: unit
              ORGANISATION: org
              CITY: city
              STATE: state
              COUNTRY_CODE: country
            healthcheck:
              test: ["CMD-SHELL", "curl -f http://domain:8080 || exit 1"]
              interval: 1m30s
              timeout: 10s
              retries: 5
              start_period: 10s   
            depends_on:
            - db
            networks:
            - local 
            links:
            - baserow:baserow
    
    baserow:
            container_name: baserow
            image: baserow/baserow:1.23.2
            environment:
                    BASEROW_PUBLIC_URL: 'http://localhost'
                    DATABASE_HOST: db
                    DATABASE_PORT: 5432
                    DABATASE_NAME:  baserow
                    DATABASE_USER: postgres
                    DATABASE_PASSWORD: postgres
                    BASEROW_EXTRA_ALLOWED_HOSTS: baserow
            ports:
            - "80:80"
            - "443:443"
            volumes:
            - baserow_data:/baserow/data
            depends_on:
            - db
            networks:
            - local   
            external_links:
            - baserow

volumes:
postgres_data:
baserow_data:

networks:
local:
driver: bridge

Postman GET command:

Hi @fpgdesa, it is currently only possible to access the Baserow API via your BASEROW_PUBLIC_URL. This is because Baserow also contains an application builder where applications can be published to any other domain. We have an issue to on the backlog to support multiple URLs here Allow setting multiple BASEROW_PUBLIC_URL (#2499) · Issues · Baserow / baserow · GitLab.

Meanwhile, you could switch to the multiservice mode of Baserow. This will allow you to connect to the backend directly. Install with Docker compose // Baserow