forked from balloob/home-assistant-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (35 loc) · 1.04 KB
/
Copy pathDockerfile
File metadata and controls
48 lines (35 loc) · 1.04 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
# ARG BUILD_FROM
# FROM $BUILD_FROM
# # Install Chromium
# RUN apk add --no-cache \
# chromium \
# nss \
# freetype \
# harfbuzz \
# ca-certificates \
# ttf-freefont
# # Ensure Node.js and npm are installed (for Alpine-based images)
# RUN apk add --no-cache nodejs npm || echo "Node.js already installed"
FROM debian:bullseye-slim
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
RUN apt-get update && apt-get install -y \
chromium \
curl \
&& curl -fsSL https://deb.nodesource.com/setup_23.x -o nodesource_setup.sh \
&& bash nodesource_setup.sh \
&& apt-get install -y nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy package.json and package-lock.json first
COPY ha-puppet-addon/package*.json ./
# Ensure a clean state before installing
RUN npm ci --unsafe-perm
# Copy the rest of the project files
COPY ha-puppet-addon/ .
# Set Puppeteer to use Alpine Chromium
# ENV PUPPETEER_EXECUTABLE_PATH="/usr/bin/chromium"
# Run the application
CMD ["node", "http.js"]