-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
36 lines (30 loc) · 1.9 KB
/
Dockerfile
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
ARG BASE_IMAGE=python:3.8.5-buster
FROM ${BASE_IMAGE}
ARG INSTALL_PREREQUISITES="apt-get -qq -y update && apt-get -qq -y install make cpanminus libscalar-list-utils-perl libxml-parser-perl libxml-xpath-perl libxml-libxslt-perl libtext-diff-perl libyaml-perl libmime-lite-perl libfile-copy-recursive-perl libauthen-sasl-perl libxml-twig-perl libtext-csv-xs-perl libjson-perl libjson-xs-perl libnet-smtp-ssl-perl libcpan-sqlite-perl libio-string-perl sqlite3 libsqlite3-dev git sudo vim wget unzip cron"
ARG CLEAN_PREREQUISITES="apt-get -qq -y purge make cpanminus"
ARG GIT_SHA1="CUSTOM BUILD"
LABEL maintainers=" Shannon Ladymon <[email protected]>, Matt Silver <[email protected]>, Aditya Sridhar <[email protected]>, Steve Young <[email protected]>"
LABEL git_sha1="${GIT_SHA1}"
# The simplest way to handle the escaping contortions is to echo everything into a file and source it.
RUN set -ex \
&& echo ${INSTALL_PREREQUISITES} > /tmp/prereq \
&& . /tmp/prereq
WORKDIR /
RUN wget https://github.com/evernote/serge/archive/1.4.zip -O serge-1.4.zip
RUN unzip serge-1.4.zip
RUN unlink serge-1.4.zip
RUN sudo cpanm --no-wget --installdeps /serge-1.4
RUN sudo ln -s /serge-1.4/bin/serge /usr/local/bin/serge
ENV PATH="/serge-1.4/bin:${PATH}"
ENV PERL5LIB="/serge-1.4/lib${PERL5LIB:+:}${PERL5LIB}"
# We copy just the requirements.txt first to leverage Docker cache
COPY ./translation_service/requirements.txt /var/tms/translation_service/requirements.txt
COPY ./import_export/requirements.txt /var/tms/import_export/requirements.txt
RUN pip install -r /var/tms/translation_service/requirements.txt
RUN pip install -r /var/tms/import_export/requirements.txt
COPY . /var/tms
RUN mkdir /var/.ssh_keys
RUN ssh-keygen -t rsa -N "" -f /var/.ssh_keys/github_deploy_key
RUN chmod 700 /var/.ssh_keys/github_deploy_key
RUN chmod 755 /var/tms/run_serge.sh
RUN chmod 755 /var/tms/setup_cron.sh