Enhance: dockerfile(many) / Fix: docker run command as README /

docker-ignored: /.git/** & .DS_Store & npm-debug.log
This commit is contained in:
2025-12-19 22:15:00 +09:00
parent 3af5b5f87c
commit 58f82399ed
3 changed files with 28 additions and 25 deletions
+19 -21
View File
@@ -4,31 +4,29 @@ FROM --platform=$BUILDPLATFORM node:20-bullseye-slim
# Set working directory
WORKDIR /app
# Run as root
# Run as root & package install
USER root
RUN apt-get update && \
apt-get install -y \
build-essential \
python3 \
libsqlite3-dev && \
rm -rf /var/lib/apt/lists/*
# Install packages
RUN apt-get update
RUN apt-get install -y build-essential
RUN apt-get install -y python3
RUN apt-get install -y libsqlite3-dev
RUN rm -rf /var/lib/apt/lists/*
# Run as node
USER node
# Install deps
COPY --chown=node:node ./src/package*.json ./
RUN npm ci
# Copy source
COPY ./src ./
# Install dependencies
RUN npm ci --unsafe-perm
# Init replied_ids.json
COPY --chown=node:node ./src ./
RUN echo "[]" > replied_ids.json
# Copy entrypoint
COPY ./entrypoint.sh /app/docker-entrypoint.sh
RUN chmod +x /app/docker-entrypoint.sh
# entrypoint
COPY --chown=node:node ./entrypoint.sh /app/docker-entrypoint.sh
RUN sed -i 's/\r$//' /app/docker-entrypoint.sh && \
chmod +x /app/docker-entrypoint.sh
# Change line break
RUN sed -i 's/\r$//' /app/docker-entrypoint.sh
# Run
ENTRYPOINT ["/app/docker-entrypoint.sh"]
ENTRYPOINT ["/app/docker-entrypoint.sh"]