Create Dockerfile
Browse files- Dockerfile +37 -0
Dockerfile
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use the official Node.js 20 image as the base image
|
| 2 |
+
FROM node:20
|
| 3 |
+
RUN chmod 1777 /tmp
|
| 4 |
+
# Install necessary dependencies for running Chrome
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
wget \
|
| 7 |
+
gnupg \
|
| 8 |
+
ca-certificates \
|
| 9 |
+
apt-transport-https \
|
| 10 |
+
xvfb \
|
| 11 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
+
|
| 13 |
+
# Install Google Chrome
|
| 14 |
+
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
|
| 15 |
+
&& echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list \
|
| 16 |
+
&& apt-get update \
|
| 17 |
+
&& apt-get install -y google-chrome-stable \
|
| 18 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 19 |
+
|
| 20 |
+
# Set up the working directory in the container
|
| 21 |
+
WORKDIR /app
|
| 22 |
+
|
| 23 |
+
# Copy package.json and package-lock.json to the working directory
|
| 24 |
+
COPY package*.json ./
|
| 25 |
+
|
| 26 |
+
# Install Node.js dependencies
|
| 27 |
+
RUN npm install
|
| 28 |
+
|
| 29 |
+
# Copy the rest of the application code
|
| 30 |
+
COPY . .
|
| 31 |
+
|
| 32 |
+
# Expose the port your app runs on
|
| 33 |
+
EXPOSE 8080
|
| 34 |
+
|
| 35 |
+
# Command to run the application
|
| 36 |
+
|
| 37 |
+
CMD [ "node", "index.mjs" ]
|