Files
caprover/dockerfile-captain.debug
Kasra Bigdeli 683f353533
Some checks failed
Run build / build (push) Has been cancelled
Run formatter / check-code-formatting (push) Has been cancelled
Run lint / run-lint (push) Has been cancelled
Build and push the edge image / run-pre-checks (push) Has been cancelled
Build and push the edge image / build-publish-docker-hub (push) Has been cancelled
Updated to node 22
2025-06-22 18:46:47 -07:00

27 lines
1.0 KiB
Plaintext

FROM node:22
RUN apt-get update && apt-get full-upgrade -yqq && apt-get install build-essential cmake -yqq
RUN apt-get -y install netcat-traditional socat
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
ENV NODE_ENV development
EXPOSE 38000
EXPOSE 3000
ENV ACCEPTED_TERMS=true
# I don't know why, but for some reason this port
# forwarding is necessary for NodeJs debugger to be able to attach!!
RUN echo "(socat -v tcp-listen:38000,reuseaddr,fork tcp:localhost:38213) & \n node --inspect-brk=38213 /usr/src/app/built/server.js" > /usr/run-brk.sh
RUN echo "(socat -v tcp-listen:38000,reuseaddr,fork tcp:localhost:38213) & \n node --inspect=38213 /usr/src/app/built/server.js" > /usr/run.sh
RUN chmod +x /usr/run.sh
RUN chmod +x /usr/run-brk.sh
CMD ["/bin/bash" , "-c" , "/usr/run.sh" ]
### Debugging only works with chrome tools. Copy and past URL printed when service starts (starts with chrome-dev)
### Just replace the port with 38000
### change --inspect to --inspect-brk to make node wait until debug is attached.