-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (29 loc) · 1.26 KB
/
Dockerfile
File metadata and controls
37 lines (29 loc) · 1.26 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
FROM node:20.17.0-alpine3.20
ARG npmRegistryUrl=https://registry.npmjs.org/
ARG npmTag=latest
ENV name="airnode-deployer" \
baseTerraformURL="https://releases.hashicorp.com/terraform/1.9.0/terraform_1.9.0_linux_"\
appDir="/app"
ENV packageName="@api3/${name}"
LABEL application=${name} \
description="Airnode Deployer CLI"
COPY ./entrypoint.sh /entrypoint.sh
RUN ARCH=`[ $(arch) == "x86_64" ] && echo "amd64" || echo "arm64" ` && \
# Install external dependencies
apk add --update --no-cache su-exec git dos2unix build-base g++ cmake linux-headers && \
# Download Terraform binary
wget ${baseTerraformURL}${ARCH}.zip && \
unzip *.zip -d /bin && \
rm -rf *.zip && \
# Install airnode-deployer
npm set registry ${npmRegistryUrl} && \
yarn global add ${packageName}@${npmTag} && \
ln -s /usr/local/share/.config/yarn/global/node_modules/${packageName}/dist ${appDir} && \
# Create user
adduser -h ${appDir} -s /bin/false -S -D -H ${name} && \
# Git swaps out LF with CRLF on Windows but only in the working directory
dos2unix /entrypoint.sh && \
find ${appDir}/terraform -type f -exec dos2unix -q {} {} \;
WORKDIR ${appDir}
ENV GOOGLE_APPLICATION_CREDENTIALS=/app/config/gcp.json
ENTRYPOINT ["/entrypoint.sh"]