Skip to content

Run LabelStudio behind existing proxy #6767

Open
@swoKorbi

Description

@swoKorbi

Describe the bug
I want to setup LabelStudio with my exisiting Docker stack.
I already do have a Nginx container running that serves all my containers on different subdomains.

My docker-compose file for LablStudio is:

services: 
    labelstudio: 
        image: heartexlabs/label-studio:latest
        container_name: labelstudio
        ports: - "1005:8080" 
        networks: 
          - proxy 
          - labelstudio volumes: 
          - D:\docker\stacks\labelstudio\data\data:/label-studio/data 
          - D:\docker\stacks\labelstudio\data\datasets:/label-studio/datasets 
        environment: 
          - LABEL_STUDIO_HOST=https://my.url
          - LABEL_STUDIO_PORT=8080 
          - LABEL_STUDIO_LOG_LEVEL=INFO 
          - DJANGO_DB=default
          - POSTGRE_NAME=labelstudio 
          - POSTGRE_USER=labelstudio 
          - POSTGRE_PASSWORD=labelstudio 
          - POSTGRE_HOST=labelstudio_postgres 
          - POSTGRE_PORT=5432 
          - LABEL_STUDIO_LOCAL_FILES_SERVING_ENABLED=true 
          - LABEL_STUDIO_LOCAL_FILES_DOCUMENT_ROOT=/label-studio/datasets 
    labelstudio_postgres: 
        image: docker.io/library/postgres:16-alpine
        container_name: labelstudio_postgres
        environment: 
          - POSTGRES_DB=labelstudio
          - POSTGRES_USER=labelstudio 
          - POSTGRES_PASSWORD=labelstudio volumes: 
          - labelstudio-db:/var/lib/postgresql/data
        networks: 
          - labelstudio
    volumes:
        labelstudio-db: 
            external: false 
    networks: 
        proxy: 
            external: false 
            name: proxy
        labelstudio: 
            external: false
            name: labelstudio

My nginx.conf file for LabelStudio is:

events { worker_connections 1024; } 

http { 
  server { 
    listen 80 default_server; 
    server_name _; return 301 https://$host$request_uri; 
  } 
  server { 
    listen 443 ssl;
    server_name my.url;
    client_max_body_size 0; 
    ssl_password_file /var/lib/nginx/ssl_passwords.pass; 
    ssl_certificate /etc/nginx/ssl/vert.crt; 
    ssl_certificate_key /etc/nginx/ssl/vert.key; 

    location / { proxy_pass http://labelstudio:1005/; } }

Unfortunately I do get 502 Bad Gatway when I try to connec tin the browser and 1111 Connection refused to upstream server in my nginx container.

Do i have to set any other environment variables for lablstudio i am missing or do i have to change my nginx conf?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions