File size: 1,260 Bytes
5c92fe7
 
deb0ca6
 
5c92fe7
f82c7b7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
deb0ca6
 
 
 
 
 
 
5c92fe7
deb0ca6
 
 
 
 
 
 
 
 
 
5c92fe7
 
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
FROM python:3.12-slim

RUN apt-get update && \
    apt-get install -y libgomp1 openjdk-17-jre-headless wget unzip libgoogle-perftools-dev libsparsehash-dev git cmake build-essential

# Set up a new user named "user" with user ID 1000
RUN useradd -m -u 1000 user

# Switch to the "user" user
USER user

# Set home to the user's home directory
ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH

# Set the working directory to the user's home directory
WORKDIR $HOME/app

COPY --chown=user fast_align_config ./fast_align_config
COPY --chown=user src ./src
COPY --chown=user gradio_app.py .
COPY --chown=user requirements.txt .

# download and compile fast align
RUN git clone https://github.com/clab/fast_align.git fast_align_src && \
    cd fast_align_src && \
    mkdir build && \
    cd build && \
    cmake .. && \
    make

RUN cp fast_align_src/build/fast_align .
RUN cp fast_align_src/build/atools .
RUN rm -rf fast_align_src

# download okapi tikal
RUN wget https://okapiframework.org/binaries/main/1.47.0/okapi-apps_gtk2-linux-x86_64_1.47.0.zip
RUN unzip okapi-apps_gtk2-linux-x86_64_1.47.0.zip -d okapi-apps_gtk2-linux-x86_64_1.47.0

RUN pip install -r requirements.txt
RUN python -m spacy download xx_ent_wiki_sm

CMD ["python", "gradio_app.py"]