𝗗𝗲𝗽𝗹𝗼𝘆 𝗟𝗮𝗯𝗲𝗹 𝗦𝘁𝘂𝗱𝗶𝗼 𝗼𝗻 𝗨𝗯𝘂𝗻𝘁𝘂 𝟮𝟰.𝟬𝟰

Label Studio helps you label text, images, audio, and video. You can use it for machine learning workflows and team collaboration.

This guide shows you how to deploy Label Studio using Docker Compose and Traefik. Traefik provides automatic HTTPS for your domain.

Follow these steps to set it up.

  1. Prepare your directory

Run these commands to create a folder for your project:

$ mkdir ~/labelstudio $ cd ~/labelstudio

  1. Set your environment variables

Create a .env file:

$ nano .env

Add your domain and email:

DOMAIN=labelstudio.example.com LETSENCRYPT_EMAIL=admin@example.com

  1. Create the Docker Compose file

Create a file named docker-compose.yaml:

$ nano docker-compose.yaml

Paste this configuration:

services: traefik: image: traefik:v3.6 container_name: traefik command: - "--providers.docker=true" - "--providers.docker.exposedbydefault=false" - "--entrypoints.web.address=:80" - "--entrypoints.websecure.address=:443" - "--entrypoints.web.http.redirections.entrypoint.to=websecure" - "--entrypoints.web.http.redirections.entrypoint.scheme=https" - "--certificatesresolvers.letsencrypt.acme.httpchallenge=true" - "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web" - "--certificatesresolvers.letsencrypt.acme.email=${LETSENCRYPT_EMAIL}" - "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json" ports: - "80:80" - "443:443" volumes: - "./letsencrypt:/letsencrypt" - "/var/run/docker.sock:/var/run/docker.sock:ro" restart: unless-stopped

labelstudio: image: heartexlabs/label-studio:1.23.0 container_name: labelstudio expose: - "8080" environment: - DJANGO_ALLOWED_HOSTS=${DOMAIN} - CSRF_TRUSTED_ORIGINS=https://${DOMAIN} - USE_X_FORWARDED_HOST=true - SECURE_PROXY_SSL_HEADER=HTTP_X_FORWARDED_PROTO,https volumes: - ./data:/label-studio/data labels: - "traefik.enable=true" - "traefik.http.routers.labelstudio.rule=Host(${DOMAIN})" - "traefik.http.routers.labelstudio.entrypoints=websecure" - "traefik.http.routers.labelstudio.tls.certresolver=letsencrypt" - "traefik.http.services.labelstudio.loadbalancer.server.port=8080" restart: unless-stopped

  1. Thiết lập quyền và bắt đầu

Tạo thư mục data:

$ mkdir data $ sudo chown :0 data

Chạy các dịch vụ:

$ docker compose up -d

  1. Xác minh thiết lập

Kiểm tra xem các container của bạn có đang chạy không:

$ docker compose ps

Truy cập công cụ của bạn tại https://labelstudio.example.com. Đăng ký để tạo tài khoản quản trị.

Các bước tiếp theo cho dự án của bạn:

Nguồn: https://dev.to/vultr/deploying-label-studio-open-source-data-labeling-platform-on-ubuntu-2404-5bd0

Cộng đồng học tập tùy chọn: https://t.me/GyaanSetuAi