FROM node:19.1.0-alpine3.16 # Arguments ARG APP_HOME=/home/node/app # Install system dependencies RUN apk add gcompat tini git jq curl # Ensure proper handling of kernel signals ENTRYPOINT [ "tini", "--" ] # Create app directory WORKDIR ${APP_HOME} ENV fetch "" # Install app dependencies # COPY package*.json post-install.js ./ RUN --mount=type=secret,id=url,mode=0444,required=true \ git clone $(cat /run/secrets/url) --branch 1.13.0 . RUN \ echo "*** Install npm packages ***" && \ npm i --no-audit --no-fund --loglevel=error --no-progress --omit=dev && npm cache clean --force # Bundle app source # COPY . ./ ADD launch.sh ./launch.sh ADD config ./config RUN --mount=type=secret,id=async,mode=0444,required=true \ curl -JLO $(cat /run/secrets/async) RUN chmod +x launch.sh && chmod +x git-batch && ./git-batch -h # Copy default chats, characters and user avatars to .default folder RUN \ rm -f "config.yaml" || true && \ ln -s "./config/config.yaml" "config.yaml" || true # Cleanup unnecessary files RUN \ echo "*** Cleanup ***" && \ mv "./docker/docker-entrypoint.sh" "./" && \ rm -rf "./docker" && \ echo "*** Make docker-entrypoint.sh executable ***" && \ chmod +x "./docker-entrypoint.sh" && \ echo "*** Convert line endings to Unix format ***" && \ dos2unix "./docker-entrypoint.sh" && \ dos2unix "./launch.sh" RUN chmod -R 777 ${APP_HOME} EXPOSE 7860 CMD ./launch.sh env && ./launch.sh init && ./docker-entrypoint.sh