dockerfile
ARG DEBIAN_VERSION=bookwormARG NODE_VERSION=20# # Use a builder to build the Krawler#FROM node:${NODE_VERSION}-${DEBIAN_VERSION} AS builder# Install krawlerCOPY . /opt/krawlerWORKDIR /opt/krawler# Build krawlerRUN yarn ## Make a slim image and copy from the build#FROM node:${NODE_VERSION}-${DEBIAN_VERSION}-slimLABEL maintainer="Kalisio <contact@kalisio.xyz>" # Install Krawler, change owner to 'node' userCOPY --from=builder --chown=node:node /opt/krawler /opt/krawlerWORKDIR /opt/krawler # Now run operations as 'node' userUSER node # - Make krawler available for others to link# - Make it executable, yarn link didn't do itRUN yarn link && chmod u+x ~/.yarn/bin/krawler # Put a symlink in /usr/local/bin# This is a bit of a hack but I couldnt make 'krawler' command available# using ENV PATH="${PATH}:~/.yarn/bin"USER rootRUN ln -s /home/node/.yarn/bin/krawler /usr/local/binUSER node # Add healthcheckHEALTHCHECK --interval=30s --timeout=30s --start-period=30s CMD node ./healthcheck.js # Set commandCMD krawler $ARGS