forked from shalzz/ethereum-worker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
48 lines (34 loc) · 1.83 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
FROM node:18.16.1-alpine as builder
WORKDIR /app
## -- Coping and installing project dependencies
COPY yarn.lock .
COPY package.json .
RUN yarn install --frozen-lock-file
COPY ./src src
COPY ./tsconfig.json .
## -- Transpiling
RUN yarn build
## -- Compile js to binary
RUN yarn pkg .
# --
FROM alpine:20231219 as runner
WORKDIR /app
## -- Installing general depencies
RUN apk add -X https://dl-cdn.alpinelinux.org/alpine/v3.16/main -u alpine-keys
RUN apk add --upgrade --no-cache openssl libgcc libstdc++ ncurses-libs libc6-compat gcompat ca-certificates wget curl
## -- Installing glibc and glibc locales dependencies (It's needed to run the binary file )
# RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
# RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r1/glibc-2.35-r1.apk
# RUN curl -L https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r1/glibc-2.35-r1.apk > glibc-2.35-r1.apk
# RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r1/glibc-bin-2.35-r1.apk
# RUN curl -L https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r1/glibc-bin-2.35-r1.apk > glibc-bin-2.35-r1.apk
# RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r1/glibc-i18n-2.35-r1.apk
# RUN curl -L https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r1/glibc-i18n-2.35-r1.apk > glibc-i18n-2.35-r1.apk
# RUN apk add --allow-untrusted --force-overwrite glibc-bin-2.35-r1.apk glibc-i18n-2.35-r1.apk glibc-2.35-r1.apk
# RUN /usr/glibc-compat/bin/localedef -i en_US -f UTF-8 en_US.UTF-8
## -- Cleaning remmaining packages
# RUN rm glibc-bin-2.35-r1.apk glibc-i18n-2.35-r1.apk glibc-2.35-r1.apk
## -- Setup binary file
COPY --from=builder /app/bin/ethereum-worker-linux /bin/ethp
RUN chmod +x /bin/ethp
CMD ["ethp"]