d2l-ui / docker-compose.yml
Berkkirik's picture
Deploy: 2026-05-04T11:20:23Z
6db5454
# Etiya doc-to-lora UI — local container deployment
#
# Usage:
# 1. cp .env.example .env.local (or set HF_TOKEN in your shell)
# 2. docker compose up --build (builds image, starts container)
# 3. open http://localhost:3000
#
# To rebuild after code changes:
# docker compose up --build --force-recreate
#
# To inspect inside the container:
# docker compose exec d2l-ui sh
services:
d2l-ui:
build:
context: .
dockerfile: Dockerfile
image: etiya/d2l-ui:latest
container_name: d2l-ui
restart: unless-stopped
ports:
# Local dev exposes 3000; container internally listens on PORT env (default 7860 in image).
# Override PORT inside container to 3000 to match the local convention.
- "3000:3000"
environment:
PORT: 3000
# HF_TOKEN read from .env.local (host) at container startup —
# never baked into the image. Rotate by editing .env.local + restarting.
HF_TOKEN: ${HF_TOKEN:?HF_TOKEN must be set in .env.local or shell}
D2L_API_URL: ${D2L_API_URL:-https://etiya-d2l-api.hf.space}
NODE_ENV: production
env_file:
- .env.local
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
# Resource limits — tune to host. Frontend is light (~150MB image, ~80MB RAM).
deploy:
resources:
limits:
cpus: "1.0"
memory: 512M
reservations:
cpus: "0.25"
memory: 128M