Question

Getting 401 when I embed gooddata within docker-compose

  • 14 October 2021
  • 2 replies
  • 56 views

Trying to run our web app with Good Data embedded within a docker container.  They IP that is making the request is internal, http://172.19.0.4,  I believe this is why we are getting the 401 unauthorized access when we try to access the app.  The app works fine from outside the docker container.

Looking for suggestions on how to get around this problem or if anyone has encountered it

This is a snipit of our docker-compose file

 

version: '3'

services:
  server:
    build:
      context: .
      dockerfile: ./docker/server/Dockerfile
    container_name: server
    hostname: ${HOSTNAME}
    restart: unless-stopped
    ports:
      - "8000:8000"
      - "8080:8080"
  nginx:
    image: nginx:stable-alpine
    container_name: nginx
    hostname: nginx
    restart: unless-stopped
    command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /data/var/docker/volumes/nginx_web/etc/nginx/conf.d:/etc/nginx/conf.d
      - /data/var/docker/volumes/certbot/etc/letsencrypt:/etc/letsencrypt
      - /data/var/docker/volumes/certbot/var/www/certbot:/var/www/certbot
  certbot:
    image: certbot/certbot
    container_name: certbot
    hostname: certbot
    restart: unless-stopped
    entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
    volumes:
      - /data/var/docker/volumes/certbot/etc/letsencrypt:/etc/letsencrypt
      - /data/var/docker/volumes/certbot/var/www/certbot:/var/www/certbot
  watchtower:
    image: containrrr/watchtower
    restart: always
    container_name: watchtower
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

networks:
  default:
    external:
      name: holnet


2 replies

Hi Nuran, I know about the ticket related to this question - https://gooddata.zendesk.com/agent/tickets/103830. I have additional questions there. Honza Basko

Userlevel 2

If the application works fine outside the docker container and there are some issues once it is deployed to docker, then the issue will be somewhere in the configuration of the deployment which impacts the application.

Reason of the 401 is that the user is not authenticated. I recommend to check from where you get the 401. In case it is from GoodData, please check if the authentication itself fails or what is the request. This could help in investigation what is wrong and impacting the docker deployment.

Reply