forked from lowlighter/metrics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (40 loc) · 1.7 KB
/
Dockerfile
File metadata and controls
58 lines (40 loc) · 1.7 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
# Base image
FROM node:20-bookworm-slim
# Copy repository
COPY . /metrics
WORKDIR /metrics
# Make action executable
RUN chmod +x /metrics/source/app/action/index.mjs
# Update package lists
RUN apt-get update
# Install wget, gnupg, and certificates needed for adding Google Chrome repository
RUN apt-get install -y wget gnupg ca-certificates libgconf-2-4
# Add Google Chrome repository key
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
# Add Google Chrome repository
RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
# Update package lists again after adding new repository
RUN apt-get update
# Install Chrome and required fonts
RUN apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 libx11-xcb1 libxtst6 lsb-release libxslt-dev libxml2-dev build-essential jq --no-install-recommends
# Install dependencies for deno
RUN apt-get install -y curl unzip
# Install deno
RUN curl -fsSL https://deno.land/x/install/install.sh | DENO_INSTALL=/usr/local sh
# Install ruby and dependencies for licensed gem
RUN apt-get install -y ruby-full git g++ cmake pkg-config libssl-dev
# Install licensed gem
RUN gem install licensed
# Install python for node-gyp
RUN apt-get install -y python3
# Clean apt cache to reduce image size
RUN rm -rf /var/lib/apt/lists/*
# Install node modules
RUN npm install --force
# Build the project
RUN npm run build
# Environment variables
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_BROWSER_PATH=google-chrome-stable
# Execute GitHub action
ENTRYPOINT ["node", "/metrics/source/app/action/index.mjs"]