-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
38 lines (36 loc) · 1.76 KB
/
Dockerfile
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
FROM debian:12-slim
LABEL org.opencontainers.image.authors="Dirk Stolle <[email protected]>"
LABEL org.opencontainers.image.source=https://github.com/striezel/plotly-node-export-server
LABEL org.opencontainers.image.licenses=GPL-3.0-or-later
# Always update package lists and install updates first.
# HTTPS transport for APT is required to get the Node.js packages.
# curl, GnuPG and CA certificates are needed to get the key for the Nodesource
# APT repository.
RUN apt-get update && apt-get upgrade -y && \
apt-get install --no-install-recommends -y \
apt-transport-https \
curl \
gnupg2 \
dirmngr \
ca-certificates \
libfontconfig1
# Node.js is required to run this application.
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update && apt-get install nodejs -y
# In some rare cases, the Node.js version in Debian stable may be more recent
# than the one provided by nodesource.com. In that case, the version from the
# Debian stable repository will be installed. But since Debian stable split the
# NPM binary into another package, this will have to be installed separately.
RUN npm --version || apt-get install -y --no-install-recommends --no-install-suggests npm
# Create directory for application.
RUN mkdir -p /opt/export-server
# Copy all files to that directory.
COPY export-server /opt/export-server
WORKDIR /opt/export-server
# Install required Node.js packages (basically jsdom).
RUN npm install
# Node.js server runs on port 3000.
EXPOSE 3000
# Start server via NPM.
CMD npm start