|
1 |
| -FROM zenika/alpine-chrome:99 as slim |
| 1 | +FROM alpine:3.16.1 AS kelly-base |
| 2 | +# LABEL org.opencontainers.image.title # set by CI |
| 3 | +LABEL org.opencontainers.image.description="Get Shopee coins everyday" |
| 4 | +# LABEL org.opencontainers.image.version # set by CI |
| 5 | +# LABEL org.opencontainers.image.authors # set by CI |
| 6 | +# LABEL org.opencontainers.image.url # set by CI |
| 7 | +# LABEL org.opencontainers.image.source # set by CI |
| 8 | +# LABEL org.opencontainers.image.created # set by CI |
| 9 | +# LABEL org.opencontainers.image.documentation # set by CI |
| 10 | +# LABEL org.opencontainers.image.revision # set by CI |
| 11 | +LABEL org.opencontainers.image.licenses="MIT" |
2 | 12 |
|
3 |
| -LABEL maintainer= "Hyperbola <[email protected]>" |
4 |
| -LABEL org.label-schema.name="Shopee Coins Bot" |
5 |
| -LABEL org.label-schema.description="Get shopee coins everyday." |
6 |
| -LABEL org.label-schema.url="https://github.com/wdzeng/shopee-coins-bot" |
7 | 13 |
|
| 14 | +# Install required packages and add a non-root user |
8 | 15 | USER root
|
9 |
| -RUN apk add --no-cache chromium-chromedriver nodejs tini |
| 16 | +RUN apk add --no-cache chromium chromium-chromedriver nodejs tini \ |
| 17 | + && adduser -u 1000 -H -D bot |
| 18 | +ENV IMAGE_VARIANT=kelly |
| 19 | +ENV TZ=Asia/Taipei |
| 20 | +ENV CHROME_BIN=/usr/bin/chromium-browser |
| 21 | +ENV CHROME_PATH=/usr/lib/chromium/ |
| 22 | + |
| 23 | + |
| 24 | +# The regular image that contains CJK font |
| 25 | +FROM kelly-base AS base |
| 26 | +USER root |
| 27 | +RUN apk add --no-cache font-noto-cjk |
| 28 | +ENV IMAGE_VARIANT=regular |
| 29 | + |
| 30 | + |
| 31 | +FROM kelly-base as kelly |
| 32 | +USER bot |
10 | 33 | COPY dist /app
|
| 34 | +WORKDIR /app |
| 35 | +ENTRYPOINT [ "tini", "--", "node", "index.js" ] |
11 | 36 |
|
12 |
| -USER chrome |
13 |
| -ENV TZ="Asia/Taipei" |
| 37 | + |
| 38 | +FROM base |
| 39 | +USER bot |
| 40 | +COPY dist /app |
14 | 41 | WORKDIR /app
|
15 | 42 | ENTRYPOINT [ "tini", "--", "node", "index.js" ]
|
0 commit comments