Spaces:
Sleeping
Sleeping
| # Stage 1 — extract ConlluEditor from the official image | |
| FROM jheinecke/conllueditor:latest AS conllu | |
| # Stage 2 — real runtime with package manager | |
| FROM debian:stable-slim | |
| # Install Java + Python | |
| RUN apt-get update && apt-get install -y \ | |
| openjdk-21-jre-headless \ | |
| python3 \ | |
| python3-pip \ | |
| python3-venv \ | |
| bash \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy ConlluEditor from stage 1 | |
| COPY --from=conllu /usr/src/ConlluEditor /usr/src/ConlluEditor | |
| # Copy proxy + upload server | |
| COPY proxy /proxy | |
| # Create a virtual environment for Python | |
| RUN python3 -m venv /opt/venv | |
| ENV PATH="/opt/venv/bin:$PATH" | |
| # Install Python dependencies inside the venv | |
| RUN pip install --no-cache-dir -r /proxy/requirements.txt | |
| # Persistent storage | |
| VOLUME /data | |
| # Expose HF port | |
| EXPOSE 7860 | |
| # Start: | |
| # - ConlluEditor on 5555 | |
| # - Upload API on 5556 | |
| # - Reverse proxy on 7860 | |
| ENV validator=none | |
| CMD bash -c "\ | |
| mkdir -p /data && \ | |
| [ -f /data/default.conllu ] || echo '# empty' > /data/default.conllu && \ | |
| bash /usr/src/ConlluEditor/dockerstart.sh /data/default.conllu 5555 & \ | |
| python3 /proxy/upload_api.py --port 5556 & \ | |
| python3 /proxy/proxy_server.py --port 7860 \ | |
| " | |