File size: 1,341 Bytes
6efa67a 631ca78 6efa67a 631ca78 2f35845 6efa67a 2f35845 c498743 6efa67a |
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
FROM node:lts-alpine3.22
# Arguments
ARG APP_HOME=/home/node/app
# Install system dependencies
RUN apk add --no-cache gcompat tini git git-lfs
# Create app directory
WORKDIR ${APP_HOME}
# Set NODE_ENV to production
ENV NODE_ENV=production
# Bundle app source
COPY . ./
RUN \
echo "*** Install npm packages ***" && \
npm ci --no-audit --no-fund --loglevel=error --no-progress --omit=dev && npm cache clean --force
# Create config and data directories with proper permissions
RUN \
rm -f "config.yaml" || true && \
mkdir -p "config" "data" && \
chmod -R 777 "data" "config" /home/node
# Pre-compile public libraries
RUN \
echo "*** Run Webpack ***" && \
node "./docker/build-lib.js"
# Set the entrypoint script
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"
# Fix extension repos permissions
RUN git config --global --add safe.directory "*"
# Ensure data directory exists and is writable
RUN mkdir -p /home/node/app/data && chmod 777 /home/node/app/data
EXPOSE 8000
# Ensure proper handling of kernel signals
ENTRYPOINT ["tini", "--", "./docker-entrypoint.sh"]
|