-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (34 loc) · 1.07 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
FROM node:20-alpine
# datatruck
RUN apk add --no-cache \
restic \
git \
less \
mariadb-client \
mariadb-backup \
postgresql-client \
mongodb-tools \
python3 \
tar \
pigz
ENV NODE_PATH=/usr/local/lib/node_modules
ARG BIN_PATH=/usr/local/bin/datatruck
ARG SHORTBIN_PATH=/usr/local/bin/dtt
ARG ENTRYPOINT_PATH=/usr/local/bin/docker-entrypoint.sh
WORKDIR /var/lib/datatruck/
COPY . /var/lib/datatruck
RUN set -x \
&& npm install -g pnpm@9 \
&& pnpm install \
&& pnpm build \
&& echo "#!/bin/sh" > $BIN_PATH \
&& echo "node /var/lib/datatruck/packages/cli/lib/bin.js \"\$@\"" >> $BIN_PATH \
&& cp "/var/lib/datatruck/docker/docker-entrypoint.sh" $ENTRYPOINT_PATH \
&& cp $BIN_PATH $SHORTBIN_PATH \
&& chmod +x $BIN_PATH $SHORTBIN_PATH $ENTRYPOINT_PATH \
&& mkdir -p "/usr/local/lib/node_modules/@datatruck" \
&& ln -s "/var/lib/datatruck/packages/cli/lib" "/usr/local/lib/node_modules/@datatruck/cli" \
&& pnpm prune --production \
&& npm uninstall -g pnpm
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["start"]