𝗗𝗲𝗽𝗹𝗼𝘆 𝗟𝗮𝗯𝗲𝗹 𝗦𝘁𝘂𝗱𝗶𝗼 𝗼𝗻 𝗨𝗯𝘂𝗻𝘁𝘂 𝟮𝟰.𝟬𝟰
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.
- Prepare your directory
Run these commands to create a folder for your project:
$ mkdir ~/labelstudio $ cd ~/labelstudio
- Set your environment variables
Create a .env file:
$ nano .env
Add your domain and email:
DOMAIN=labelstudio.example.com LETSENCRYPT_EMAIL=admin@example.com
- 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
- Налаштування дозволів та запуск
Створіть папку data:
$ mkdir data $ sudo chown :0 data
Запустіть сервіси:
$ docker compose up -d
- Перевірка налаштування
Перевірте, чи працюють ваші контейнери:
$ docker compose ps
Перейдіть до свого інструмента за посиланням https://labelstudio.example.com. Зареєструйтеся, щоб створити обліковий запис адміністратора.
Наступні кроки для вашого проєкту:
- Підключіть ML-бекенди, такі як PyTorch, для активного навчання.
- Запросіть членів команди з певними ролями.
- Експортуйте свої дані у таких форматах, як JSON, CSV або YOLO.
Джерело: https://dev.to/vultr/deploying-label-studio-open-source-data-labeling-platform-on-ubuntu-2404-5bd0
Додаткова спільнота для навчання: https://t.me/GyaanSetuAi