-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
66 lines (51 loc) · 1.64 KB
/
Dockerfile
File metadata and controls
66 lines (51 loc) · 1.64 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
### File: Dockerfile
##
## anki-card-cli用のDockerイメージを組み立てる。
##
## Usage:
##
## ------ Text ------
## docker buildx build -f Dockerfile
## ------------------
##
## Build arg:
##
## BASE - ベースとするイメージ名。
## FONTS - インストールするフォント。
##
## Metadata:
##
## id - ec200ad7-f5c6-4db9-87e8-0958b21b25f2
## author - <qq542vev at https://purl.org/meta/me/>
## version - 1.0.0
## created - 2025-12-11
## modified - 2026-01-06
## copyright - Copyright (C) 2025-2025 qq542vev. All rights reserved.
## license - <AGPL-3.0-only at https://www.gnu.org/licenses/agpl-3.0.txt>
## conforms-to - <https://docs.docker.com/reference/dockerfile/>
##
## See Also:
##
## * <Project homepage at https://github.com/qq542vev/anki-card-cli>
## * <Bag report at https://github.com/qq542vev/anki-card-cli/issues>
ARG BASE="docker.io/library/node:24-trixie-slim"
FROM ${BASE} AS npm
WORKDIR /app
ENV PUPPETEER_SKIP_DOWNLOAD="true"
COPY index.js package.json package-lock.json .
RUN npm ci --production
FROM ${BASE}
ARG BASE
LABEL org.opencontainers.image.base.name="${BASE}"
ENV DEBIAN_FRONTEND="noninteractive"
ENV PUPPETEER_EXECUTABLE_PATH="/usr/bin/chromium"
RUN \
apt-get update && \
apt-get install -y --no-install-recommends chromium
ARG FONTS=""
RUN case "${FONTS}" in ?*) apt-get install -y --no-install-recommends ${FONTS} && fc-cache -fv;; esac
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
ARG WORKDIR="/root/anki-card-cli"
WORKDIR "${WORKDIR}"
COPY --from=npm /app "${WORKDIR}"
ENTRYPOINT ["node", "index.js", "--chrome-arg", "--no-sandbox", "--chrome-arg", "--disable-setuid-sandbox"]