File size: 1,697 Bytes
ff883f5
 
 
 
 
 
 
 
3b1b7cc
ff883f5
 
 
 
 
 
 
2cd1bf6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3b1b7cc
 
 
ff883f5
3b1b7cc
 
 
 
ff883f5
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
FROM node:20-alpine3.16
WORKDIR /app
ADD . /app

# install dependency sistem
RUN apk add --no-cache \
    font-noto font-noto-cjk font-noto-extra gcompat libstdc++ libuuid \
    vips-dev build-base jpeg-dev pango-dev cairo-dev imagemagick libssl1.1 \
    curl ca-certificates

# buat symlink resolv
RUN ln -s /lib/libresolv.so.2 /usr/lib/libresolv.so.2

# install node modules
RUN npm install

# download assets
RUN mkdir -p assets/emoji

# download pattern images
RUN curl -fsSL -o assets/pattern_02.png \
    https://raw.githubusercontent.com/LyoSU/quote-api/master/assets/pattern_02.png \
 && curl -fsSL -o assets/pattern_ny.png \
    https://raw.githubusercontent.com/LyoSU/quote-api/master/assets/pattern_ny.png \
 && curl -fsSL -o assets/pattern_ny_old.png \
    https://raw.githubusercontent.com/LyoSU/quote-api/master/assets/pattern_ny_old.png

# download emoji JSON files
RUN curl -fsSL -o assets/emoji/emoji-apple-image.json \
    https://raw.githubusercontent.com/LyoSU/quote-api/master/assets/emoji/emoji-apple-image.json \
 && curl -fsSL -o assets/emoji/emoji-google-image.json \
    https://raw.githubusercontent.com/LyoSU/quote-api/master/assets/emoji/emoji-google-image.json \
 && curl -fsSL -o assets/emoji/emoji-joypixels-image.json \
    https://raw.githubusercontent.com/LyoSU/quote-api/master/assets/emoji/emoji-joypixels-image.json \
 && curl -fsSL -o assets/emoji/emoji-twitter-image.json \
    https://raw.githubusercontent.com/LyoSU/quote-api/master/assets/emoji/emoji-twitter-image.json

# verify downloaded files
RUN ls -lah assets/ && ls -lah assets/emoji/

EXPOSE 7860

# Set DNS untuk runtime
ENV NODE_OPTIONS="--dns-result-order=ipv4first"

CMD ["node", "index.js"]