debugService2 / Dockerfile
deepak191z's picture
Update Dockerfile
14dc4c1 verified
raw
history blame
789 Bytes
FROM node:18-slim
# Install OpenJDK 17 and Git (required for apk-mitm and git clone)
RUN apt-get update && apt-get install -y \
openjdk-17-jdk \
git \
&& rm -rf /var/lib/apt/lists/*
ENV HOME=/home/node
ENV PATH=/home/node/.local/bin:$PATH
WORKDIR $HOME/app
# Use BuildKit secret to clone the repository (ensure BuildKit is enabled)
RUN --mount=type=secret,id=URL,mode=0444,required=true \
git clone https://$(cat /run/secrets/URL) .
# Install global apk-mitm and project dependencies as root
RUN npm install -g apk-mitm
RUN npm install
# Create uploads directory and adjust permissions
RUN mkdir -p $HOME/app/uploads && chown -R node:node $HOME/app
# Switch to the pre-created node user for running the app
USER node
ENV PORT=7860
EXPOSE 7860
CMD ["npm", "start"]