-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (27 loc) · 1.1 KB
/
Dockerfile
File metadata and controls
34 lines (27 loc) · 1.1 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
FROM node:22.12.0-alpine3.21
ARG npmRegistryUrl=https://registry.npmjs.org/
ARG npmTag=latest
ENV name="airnode-client" \
packageName="@api3/airnode-node" \
appDir="/app"
ENV cronjob="/etc/cron.d/${name}"
LABEL application=${name} \
description="Airnode Client"
COPY airnode-crontab ${cronjob}
COPY entrypoint.sh /entrypoint.sh
# Install Tini to correctly pass signals
RUN apk add --update --no-cache tini dos2unix build-base g++ cmake linux-headers && \
# Install airnode-node
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} && \
# Enable Airnode cronjob
chmod +x ${cronjob} && \
crontab -u ${name} ${cronjob} && \
# Git swaps out LF with CRLF on Windows but only in the working directory
dos2unix /entrypoint.sh
WORKDIR ${appDir}
# We need to run the cron daemon as root but the Airnode itself is run under the airnode user
ENTRYPOINT ["tini", "--", "/entrypoint.sh"]