I am trying to creating a container with Node + Electron, but the container it's not starting when I run the command
docker logs idcontainer
its showing this error:
webpack serve --mode development --progress --config build/webpack.dev.conf.js electron
sh: 1: webpack: not found
this is my dockerfile
FROM node:19-bullseye
RUN apt-get update
RUN apt-get update && apt-get install \
git libx11-xcb1 libxcb-dri3-0 libxtst6 libnss3 libatk-bridge2.0-0 libgtk-3-0 libxss1 libasound2 \
-yq --no-install-suggests --no-install-recommends \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN mkdir -p /home/app/ && chown -R node:node /home/app/
WORKDIR /home/app/
USER node
COPY . /home/app/
RUN npm install --save-dev webpack webpack-cli webpack-dev-server
RUN npm install --save-dev electron
RUN npm install install
RUN npx electron-rebuild
USER root
RUN chown root /home/app/node_modules/electron/dist/chrome-sandbox
RUN chmod 4755 /home/app/node_modules/electron/dist/chrome-sandbox
USER node
EXPOSE 6665
CMD ["npm", "run"]
CMD ["npm", "start", "electron"]
and this is my docker-compose
version: "3"
services:
service:
build: .
ports:
- '6665:6665'
container_name: serviceDesktop
volumes:
- .:/home/app
to create a new container with Node + Electron