Feat: default env / Fix: unable to start / Enhance: Improved line break

code conversion / Del: entrypoint / Fix: config.json value types
This commit is contained in:
2025-12-17 18:03:58 +09:00
parent b4f15bbade
commit 17105cf6ee
3 changed files with 24 additions and 10 deletions
+21 -7
View File
@@ -1,5 +1,11 @@
# Load Node.js
FROM --platform=$BUILDPLATFORM node:24.12.0-alpine3.23
# Set default env
ENV TWEET_ENABLED=true
ENV CHECK_INTERVAL=300
ENV THINK_OUTPUT_ENABLED=false
# Set working directory
WORKDIR /app
@@ -15,13 +21,21 @@ COPY ./src ./
# Create replied_ids.json
RUN touch replied_ids.json
# Setup entrypoint
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Create config.json
RUN cat <<EOF > /app/config.json
{
"host": "${UWUZU_HOST}",
"api_token": "${UWUZU_TOKEN}",
"random_ueuse": ${TWEET_ENABLED},
"check_interval": ${CHECK_INTERVAL},
"rana_core_log": ${THINK_OUTPUT_ENABLED}
}
EOF
# Change line break
RUN sed -i 's/\r$//' /entrypoint.sh \
&& find /app -type f -exec sed -i 's/\r$//' {} \;
RUN find /app -type f -print0 \
| xargs -0 grep -Il "$(printf '\r')" \
| xargs -0 sed -i 's/\r$//'
# Run entrypoint
ENTRYPOINT ["/entrypoint.sh"]
# Run
CMD [ "npm", "start" ]