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"]