forked from waves-enterprise/cryptopro-sign
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.test
70 lines (55 loc) · 2.12 KB
/
Dockerfile.test
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
# Базовый образ с КриптоПро
#FROM debian:stretch-slim as cryptopro-generic
FROM node:stretch-slim as cryptopro-generic
# Устанавливаем timezone
ENV TZ="Europe/Moscow" \
docker="1"
ARG LICENSE
ENV LICENSE ${LICENSE}
# prod или test
ARG ESIA_ENVIRONMENT='test'
ENV ESIA_CORE_CERT_FILE "/cryptopro/esia/esia_${ESIA_ENVIRONMENT}.cer"
ARG CERTIFICATE_PIN
ENV CERTIFICATE_PIN ${CERTIFICATE_PIN}
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
echo $TZ > /etc/timezone
ADD cryptopro/install /tmp/src
RUN cd /tmp/src && \
tar -xf linux-amd64_deb.tgz && \
linux-amd64_deb/install.sh && \
# делаем симлинки
cd /bin && \
ln -s /opt/cprocsp/bin/amd64/certmgr && \
ln -s /opt/cprocsp/bin/amd64/cpverify && \
ln -s /opt/cprocsp/bin/amd64/cryptcp && \
ln -s /opt/cprocsp/bin/amd64/csptest && \
ln -s /opt/cprocsp/bin/amd64/csptestf && \
ln -s /opt/cprocsp/bin/amd64/der2xer && \
ln -s /opt/cprocsp/bin/amd64/inittst && \
ln -s /opt/cprocsp/bin/amd64/wipefile && \
ln -s /opt/cprocsp/sbin/amd64/cpconfig && \
# прибираемся
rm -rf /tmp/src
RUN apt-get update && apt-get install -y --no-install-recommends expect libboost-dev unzip g++ curl
ADD cryptopro/scripts /cryptopro/scripts
ADD cryptopro/certificates /cryptopro/certificates
ADD cryptopro/esia cryptopro/esia
FROM cryptopro-generic as configured-cryptopro
# устанавливаем лицензию, если она указана
RUN ./cryptopro/scripts/setup_license ${LICENSE}
# Устанавливаем корневой сертификат есиа
RUN ./cryptopro/scripts/setup_root ${ESIA_CORE_CERT_FILE}
# Устанавливаем сертификат пользователя
RUN ./cryptopro/scripts/setup_my_certificate /cryptopro/certificates/certificate_bundle.zip ${CERTIFICATE_PIN}
FROM configured-cryptopro
COPY package.json .
COPY package-lock.json .
COPY tsconfig.json .
COPY tsconfig.build.json .
COPY .eslintrc.js .eslintrc.js
COPY .eslintignore .eslintignore
COPY versions.json versions.json
COPY src src
COPY test test
RUN npm ci -q
CMD npm run test-ci