Skip to content

Commit 395cbc8

Browse files
committed
Updating
1 parent fe69d7a commit 395cbc8

File tree

12 files changed

+1735
-21
lines changed

12 files changed

+1735
-21
lines changed

‎dockerfile

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,49 @@
11
# Use an official Node runtime as a parent image
2-
FROM node:14
2+
FROM node:16
33

44
# Set the working directory in the container
55
WORKDIR /usr/src/app
66

7-
# Copy the current directory contents into the container at /usr/src/app
8-
COPY . .
7+
# Install Chrome to run tests in a headless browser. Adjust these commands if you're using a different browser.
8+
RUN apt-get update && apt-get install -y wget gnupg \
9+
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
10+
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' \
11+
&& apt-get update \
12+
&& apt-get install -y google-chrome-stable
13+
14+
# Optionally, install ChromeDriver if required by your tests.
15+
# Make sure to match ChromeDriver version with the installed Chrome version.
16+
# This is a basic example; you might need to adjust versions and paths.
17+
RUN wget -N http://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip -P ~/ \
18+
&& unzip ~/chromedriver_linux64.zip -d ~/ \
19+
&& rm ~/chromedriver_linux64.zip \
20+
&& mv -f ~/chromedriver /usr/local/share/ \
21+
&& chmod +x /usr/local/share/chromedriver \
22+
&& ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver \
23+
&& ln -s /usr/local/share/chromedriver /usr/bin/chromedriver
24+
25+
# Copy the package.json (and possibly package-lock.json or pnpm-lock.yaml) into the container
26+
COPY package.json pnpm-lock.yaml ./
927

10-
# Install any needed packages specified in package.json
11-
RUN npm install
28+
# Install pnpm globally
29+
RUN npm install -g pnpm
30+
31+
# Install project dependencies
32+
RUN pnpm install
33+
34+
# Copy your project's source code into the container
35+
COPY . .
1236

13-
# Install Chrome for Selenium tests
14-
RUN apt-get update && apt-get install -y \
15-
gnupg \
16-
wget \
17-
&& wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
18-
&& apt install ./google-chrome-stable_current_amd64.deb -y
37+
# Build the project - this compiles your TypeScript files
38+
RUN pnpm run build
1939

20-
# Make port available to the world outside this container
40+
# Make port 8080 available to the world outside this container
2141
EXPOSE 8080
2242

23-
# Define environment variable
24-
ENV NODE_ENV production
43+
# Define environment variable for headless testing and other environment configurations
44+
ENV NODE_ENV=production \
45+
CHROME_BIN=/usr/bin/google-chrome \
46+
HEADLESS=true
2547

26-
# Run npm test when the container launches
27-
CMD ["npm", "test"]
48+
# Command to run when the container starts. This runs your regression tests.
49+
CMD ["pnpm", "run", "regression"]

‎package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@
2929
"@types/puppeteer": "^7.0.4",
3030
"@types/selenium-webdriver": "^4.1.20",
3131
"chai": "^4.3.10",
32-
"mocha": "^10.2.0",
33-
"ts-node": "^10.9.1",
3432
"copyfiles": "^2.1.0",
35-
"rimraf": "^2.6.2"
33+
"mocha": "^10.2.0",
34+
"puppeteer": "^22.4.1",
35+
"rimraf": "^2.6.2",
36+
"ts-node": "^10.9.1"
3637
}
3738
}

0 commit comments

Comments
 (0)