Skip to content

Commit 9386d17

Browse files
Merge pull request #6 from metalwarrior665/upgrade-to-v3
Upgrade to v3
2 parents fb7ee94 + 4e5a7a2 commit 9386d17

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+43614
-25806
lines changed

.eslintrc.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

checker-cheerio/.eslintrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"root": true,
3+
"env": {
4+
"browser": true,
5+
"es2020": true,
6+
"node": true
7+
},
8+
"extends": [
9+
"@apify/eslint-config-ts"
10+
],
11+
"parserOptions": {
12+
"project": "./tsconfig.json",
13+
"ecmaVersion": 2020
14+
},
15+
"ignorePatterns": [
16+
"node_modules",
17+
"dist",
18+
"**/*.d.ts"
19+
]
20+
}

checker-cheerio/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This file tells Git which files shouldn't be added to source control
2+
3+
.DS_Store
4+
.idea
5+
dist
6+
node_modules
7+
apify_storage
8+
storage
9+
storage

checker-cheerio/Dockerfile

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,51 @@
1-
FROM apify/actor-node:16
1+
# Specify the base Docker image. You can read more about
2+
# the available images at https://crawlee.dev/docs/guides/docker-images
3+
# You can also use any other image from Docker Hub.
4+
FROM apify/actor-node:16 AS builder
25

3-
# Copy the package.json and package-lock.json files, since they are the only files
4-
# that affect NPM install in the next step
6+
# Copy just package.json and package-lock.json
7+
# to speed up the build using Docker layer cache.
58
COPY package*.json ./
69

7-
# Install NPM packages, skip optional and development dependencies to keep the
8-
# image small. Avoid logging too much and print the dependency tree for debugging
10+
# Install all dependencies. Don't audit to speed up the installation.
11+
RUN npm install --include=dev --audit=false
12+
13+
# Next, copy the source files using the user set
14+
# in the base image.
15+
COPY . ./
16+
17+
# Install all dependencies and build the project.
18+
# Don't audit to speed up the installation.
19+
RUN npm run build
20+
21+
# Create final image
22+
FROM apify/actor-node:16
923

10-
# Log Node version
11-
RUN echo "Node.js version:" && node --version
24+
# Copy only built JS files from builder image
25+
COPY --from=builder /usr/src/app/dist ./dist
1226

13-
# Log npm version
14-
RUN echo "NPM version:" && npm --version
27+
# Copy just package.json and package-lock.json
28+
# to speed up the build using Docker layer cache.
29+
COPY package*.json ./
1530

16-
# Install all runtime dependencies
31+
# Install NPM packages, skip optional and development dependencies to
32+
# keep the image small. Avoid logging too much and print the dependency
33+
# tree for debugging
1734
RUN npm --quiet set progress=false \
18-
&& npm ci --only=prod --no-optional \
19-
&& echo "Installed NPM packages:" \
20-
&& (npm ls || true)
35+
&& npm install --omit=dev --omit=optional \
36+
&& echo "Installed NPM packages:" \
37+
&& (npm list --omit=dev --all || true) \
38+
&& echo "Node.js version:" \
39+
&& node --version \
40+
&& echo "NPM version:" \
41+
&& npm --version \
42+
&& rm -r ~/.npm
2143

22-
# Next, copy the remaining files and directories with the built source code.
44+
# Next, copy the remaining files and directories with the source code.
2345
# Since we do this after NPM install, quick build will be really fast
24-
# for simple source file changes.
25-
COPY ./src ./dist
46+
# for most source file changes.
47+
COPY . ./
48+
49+
50+
# Run the image.
51+
CMD npm run start:prod --silent

checker-cheerio/apify.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"name": "website-checker-cheerio",
3-
"version": "0.0.0",
2+
"name": "checker-cheerio",
3+
"version": "0.0",
44
"buildTag": "latest",
5-
"env": null,
6-
"template": "basic"
5+
"env": null
76
}

0 commit comments

Comments
 (0)