Skip to content
This repository has been archived by the owner on Jun 20, 2020. It is now read-only.

Running NickJs in node:9-alpine #52

Closed
AndrejHafner opened this issue Feb 4, 2019 · 1 comment
Closed

Running NickJs in node:9-alpine #52

AndrejHafner opened this issue Feb 4, 2019 · 1 comment

Comments

@AndrejHafner
Copy link

I tried running NickJs in node9-alpine image and I get this error:

CHROME STDERR: [0204/101402.974481:WARNING:dns_config_service_posix.cc(326)] Failed to read DnsConfig.
CHROME STDERR: [0204/101402.984254:ERROR:devtools_http_handler.cc(759)] Error writing DevTools active port to file
> It took 105ms to start and connect to Chrome (1 tries)
{
  "level": "error",
  "message": "cannot connect to chrome tab: Error: Unknown command: protocol"
}

I have added the chromium browser to the image and set the CHROME_PATH to the chromium-browser. It is also present there, I checked with running a bash in the container.
Does anyone know what to do?

My Dockerfile:

FROM node:9-alpine

ENV CHROME_PATH=/usr/bin/chromium-browser
ENV NICKJS_NO_SANDBOX=1
# ╒═════════════════════════
# │ Copy from builder
# ╘═════════════════════════
RUN mkdir -p /app
WORKDIR /app

# Node modules
COPY --from=builder /app-prod/node_modules ./node_modules

# App files
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/res ./res

COPY --from=builder /app/package.json .
COPY --from=builder /app/util/healthcheck.js .
COPY --from=builder /app/start.sh .

RUN rm -f /app/dist/source.js /app/dist/source.js.map

# ╒═════════════════════════
# │ INSTALL NATIVE
# ╘═════════════════════════
# Install native app dependencies
RUN set -ex; \
  apk add --no-cache \
    rsync \
    openssh \
    udev \
    ttf-freefont \
    chromium

# ╒═════════════════════════
# │ SETUP HEALTH CHECK
# ╘═════════════════════════
HEALTHCHECK --interval=12s --timeout=12s --retries=3 --start-period=60s \
 CMD node ./util/healthcheck.js

# Run the container under "node" user by default
#USER node
CMD [ "npm", "run", "serve" ]
@paps
Copy link
Member

paps commented Feb 11, 2019

Which version of Chromium is it? Did you try with google-chrome instead of chromium? That might do the trick

@paps paps closed this as completed Feb 11, 2019
@paps paps reopened this Feb 11, 2019
@paps paps closed this as completed Dec 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants