-
Notifications
You must be signed in to change notification settings - Fork 19
/
Dockerfile
93 lines (67 loc) · 2.8 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
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
FROM ubuntu:22.04
LABEL maintainer="Dash Developers <[email protected]>"
LABEL description="Dash Network Deployment Tool"
# Install build utils and Firefox deps
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
bzip2 \
ca-certificates \
curl \
git \
gnupg \
openvpn \
python3-pip \
python3-setuptools \
software-properties-common \
ssh \
unzip
# Install Node.JS
ENV NODE_MAJOR=20
RUN mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
nodejs
# Install terraform
ARG TERRAFORM_VERSION=1.5.7
RUN curl -fsSLO https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip -d /usr/bin && \
rm terraform_${TERRAFORM_VERSION}_linux_amd64.zip
# Install Docker client
ENV DOCKERVERSION=24.0.6
RUN curl -fsSLO https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKERVERSION}.tgz \
&& tar xzvf docker-${DOCKERVERSION}.tgz --strip 1 -C /usr/local/bin docker/docker \
&& rm docker-${DOCKERVERSION}.tgz
# Install Chrome
# Check available versions here: https://www.ubuntuupdates.org/package/google_chrome/stable/main/base/google-chrome-stable
ENV CHROMEVERSION=117.0.5938.88-1
ENV CHROME_BIN="/usr/bin/google-chrome"
RUN curl -fsSL https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROMEVERSION}_amd64.deb -o /tmp/chrome.deb \
&& apt install -y --no-install-recommends /tmp/chrome.deb \
&& rm /tmp/chrome.deb
# Copy dash-cli form dashd image
COPY --from=dashpay/dashd:latest /usr/local/bin/dash-cli /usr/local/bin
# Copy sources
WORKDIR /usr/src/app
# Install ansible playbook and Node.JS dependencies
COPY ansible/requirements.yml /ansible-requirements.yml
COPY package*.json ./
RUN python3 -m pip install -U pip && \
python3 -m pip install --upgrade netaddr awscli jmespath ansible ansible-lint boto3 botocore && \
ansible-galaxy install -r /ansible-requirements.yml && \
npm install
# Remove build utils
RUN apt-get remove --purge -y \
python3-pip \
python3-setuptools \
unzip \
curl \
&& rm -rf /var/lib/apt/lists/*
COPY . .
# Create networks shortcut
RUN ln -s /usr/src/app/networks /networks
VOLUME ["/networks"]
VOLUME ["/usr/src/app/terraform/aws/.terraform"]
ENTRYPOINT ["/usr/src/app/docker/entrypoint.sh"]
CMD ["deploy", "--help"]