File size: 645 Bytes
306d4f5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | FROM node:18
RUN apt-get update && apt-get install -y \
libnss3-dev \
ffmpeg \
git && \
apt-get upgrade -y && \
rm -rf /var/lib/apt/lists/*
RUN useradd -o -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
RUN --mount=type=secret,id=GH_TOKEN,mode=0444,required=true \
--mount=type=secret,id=REPO_URL,mode=0444,required=true \
git clone https://$(cat /run/secrets/GH_TOKEN)@$(cat /run/secrets/REPO_URL) . # Menggunakan token untuk clone repository
COPY --chown=user package*.json $HOME/app
RUN npm i
COPY --chown=user . $HOME/app
EXPOSE 7860
CMD ["node", "index.js"] |