brain.js icon indicating copy to clipboard operation
brain.js copied to clipboard

brain.js in docker container with node:alpine

Open rbjs opened this issue 3 years ago • 1 comments

I tried to containerize node app with brain.js using node:alpine image. But with any result (lots of errors).

Maybe someone had better luck?

Will be great to have official docker image for brain.js.

rbjs avatar Jul 28 '22 12:07 rbjs

I don't know if an official Docker image is really needed for Brain.js, since so few people would actually use it as their base image. Most people are going to want a base image that's a little more agnostic, like the node image.

Anyway, I got Brain.js working in node:alpine. Here's an example Dockerfile you could build upon:

FROM node:19-alpine

MAINTAINER Original Design

RUN apk update && \
    apk add \
    alpine-sdk \
    glew-dev \
    libxi-dev \
    pkgconf \
    python3

RUN ln -s /usr/bin/python3 /usr/bin/python

WORKDIR /app

COPY package*.json tsconfig.json ./

RUN npm install

COPY src ./src

RUN npm run build

RUN chown -R node /app && chmod -R 740 /app

USER node

ENV NODE_ENV=production

CMD ["npm", "start"]

Vectorrent avatar Nov 13 '22 14:11 Vectorrent