-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
51 lines (42 loc) · 1.29 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
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM node:18.15.0-buster-slim
LABEL maintainer="mattiasghodsian"
LABEL version="1.0.0"
LABEL description="A scalable and reliable Dockerized Prerender service, designed to boost web page performance through file-based caching"
# Update and install required packages
RUN apt-get update && apt-get install -y \
wget curl \
fonts-liberation \
libasound2 \
libatk-bridge2.0-0 \
libatk1.0-0 \
libatspi2.0-0 \
libcairo2 \
libcups2 \
libdbus-1-3 \
libdrm2 \
libgbm1 \
libgtk-3-0 \
libnspr4 \
libnss3 \
libpango-1.0-0 \
libu2f-udev \
libvulkan1 \
xdg-utils \
xsltproc && \
rm -rf /var/lib/apt/lists/*
# Download and install Chrome
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O /tmp/google-chrome-stable_current_amd64.deb \
&& dpkg -i /tmp/google-chrome-stable_current_amd64.deb || apt-get install -fy
# Create folders
RUN mkdir -p /srv/prerender /srv/cache
# Set the working directory for following COPY and CMD instructions
WORKDIR /srv/prerender
# Install NPM packages
COPY src/package*.json ./
RUN npm install --production
# Copy source files from local src directory to the workdir in the container
COPY src/ .
# Expose port 3000
EXPOSE 3000
# Run the application
CMD [ "node", "server.js"]