forked from Prompsit/mutnmt
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
72 lines (57 loc) · 2.6 KB
/
Dockerfile
File metadata and controls
72 lines (57 loc) · 2.6 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
FROM nvidia/cuda:12.2.2-cudnn8-devel-ubuntu22.04
RUN echo "Europe/Madrid" > /etc/timezone
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2004/x86_64/7fa2af80.pub
RUN apt-get update -q --fix-missing && \
apt-get -y upgrade
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install \
python3.10-venv python3-pip autossh \
gcc gcc-10 g++-10
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install \
redis virtualenv curl libreoffice libxml2-utils \
tzdata cmake cmake-data git build-essential pkg-config libhunspell-dev
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install \
openjdk-17-jdk moreutils default-jdk \
autoconf autopoint libtool libboost-system-dev libprotobuf23 \
protobuf-compiler libprotobuf-dev openssl libssl-dev bc zip nano wget
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install \
libgoogle-perftools-dev joe libyajl2 gawk libboost-all-dev libpq-dev && \
apt-get autoremove -y && \
apt-get autoclean
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs && curl -L https://npmjs.org/install.sh | sh
# Create needed folders and virtual environment
RUN mkdir -p /opt/mutnmt/app
RUN mkdir /opt/mutnmt/scripts
COPY scripts/requirements.txt /opt/mutnmt/scripts/requirements.txt
RUN python3.10 -m venv /opt/mutnmt/venv
# Upgrade and install needed pip build tools
RUN /usr/bin/bash -c "source /opt/mutnmt/venv/bin/activate && \
pip install -U pip && \
pip install setuptools wheel && \
deactivate"
# Install python requirements
RUN /usr/bin/bash -c "source /opt/mutnmt/venv/bin/activate && \
pip install -r /opt/mutnmt/scripts/requirements.txt && \
deactivate"
# Install joeynmt through pip, delete this when removing joeynmt from project
RUN /usr/bin/bash -c "source /opt/mutnmt/venv/bin/activate && \
pip install joeynmt && \
deactivate"
# Install Marian via cloned repository
RUN /usr/bin/bash -c "source /opt/mutnmt/venv/bin/activate && \
cd /opt/mutnmt/app/ && \
git clone https://github.com/marian-nmt/marian && \
mkdir marian/build && \
cd marian/build && \
cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_SENTENCEPIECE=ON && \
make -j4 && \
deactivate"
# Copy rest of application code
COPY . /opt/mutnmt/
# Run entry scripts
RUN /opt/mutnmt/scripts/install.sh
RUN /opt/mutnmt/scripts/minify.sh
CMD ./opt/mutnmt/scripts/docker-entrypoint.sh