update dockerfile; use incognito mode
This commit is contained in:
+32
-2
@@ -1,7 +1,37 @@
|
|||||||
FROM node:21-alpine
|
# Use the official Node.js 16 image as the base image
|
||||||
WORKDIR /usr/src/app
|
FROM node:16
|
||||||
|
|
||||||
|
# Install necessary dependencies for running Chrome
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
wget \
|
||||||
|
gnupg \
|
||||||
|
ca-certificates \
|
||||||
|
apt-transport-https \
|
||||||
|
xvfb \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Install Google Chrome
|
||||||
|
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
|
||||||
|
&& echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list \
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get install -y google-chrome-stable \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Set up the working directory in the container
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy package.json and package-lock.json to the working directory
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
|
||||||
|
# Install Node.js dependencies
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
|
# Copy the rest of the application code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# Expose the port your app runs on
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
# Command to run the application
|
||||||
|
|
||||||
CMD [ "node", "index.js" ]
|
CMD [ "node", "index.js" ]
|
||||||
@@ -54,6 +54,16 @@ function getSessionCookie(jwtSession, jwtToken) {
|
|||||||
httpOnly: true,
|
httpOnly: true,
|
||||||
secure: true,
|
secure: true,
|
||||||
sameSite: "Lax",
|
sameSite: "Lax",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "incognito",
|
||||||
|
value: "true",
|
||||||
|
domain: "you.com",
|
||||||
|
path: "/",
|
||||||
|
expires: 1800000000,
|
||||||
|
httpOnly: true,
|
||||||
|
secure: true,
|
||||||
|
sameSite: "Lax",
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user