File size: 1,189 Bytes
60c3e11
 
b51d282
60c3e11
 
b51d282
60c3e11
 
605fb01
60c3e11
 
e4b3e29
60c3e11
 
b51d282
60c3e11
 
c491791
60c3e11
2df1445
e4b3e29
 
 
 
 
 
 
c491791
 
b51d282
 
60c3e11
b51d282
 
60c3e11
 
 
 
0b89bf8
 
b51d282
0b89bf8
 
b51d282
2df1445
 
b51d282
0b89bf8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# 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 \
"