Skip to content

Commit 9d40fc4

Browse files
update dockerfile
1 parent b7edcad commit 9d40fc4

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

Diff for: Dockerfile

+24-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,33 @@
1-
FROM apify/actor-node-chrome
1+
# First, specify the base Docker image. You can read more about
2+
# the available images at https://sdk.apify.com/docs/guides/docker-images
3+
# You can also use any other image from Docker Hub.
4+
FROM apify/actor-node:16
25

3-
# Copy source code
4-
COPY . ./
6+
# Second, copy just package.json and package-lock.json since it should be
7+
# the only file that affects "npm install" in the next step, to speed up the build
8+
COPY package*.json ./
59

6-
# Install default dependencies, print versions of everything
10+
# Install NPM packages, skip optional and development dependencies to
11+
# keep the image small. Avoid logging too much and print the dependency
12+
# tree for debugging
713
RUN npm --quiet set progress=false \
814
&& npm install --only=prod --no-optional \
915
&& echo "Installed NPM packages:" \
10-
&& npm list \
16+
&& (npm list --only=prod --no-optional --all || true) \
1117
&& echo "Node.js version:" \
1218
&& node --version \
1319
&& echo "NPM version:" \
1420
&& npm --version
21+
22+
# Next, copy the remaining files and directories with the source code.
23+
# Since we do this after NPM install, quick build will be really fast
24+
# for most source file changes.
25+
COPY . ./
26+
27+
# Optionally, specify how to launch the source code of your actor.
28+
# By default, Apify's base Docker images define the CMD instruction
29+
# that runs the Node.js source code using the command specified
30+
# in the "scripts.start" section of the package.json file.
31+
# In short, the instruction looks something like this:
32+
#
33+
# CMD npm start

0 commit comments

Comments
 (0)