reverting docker file change

This commit is contained in:
orangecoding
2025-10-06 20:21:26 +02:00
parent 2e537ce0be
commit e4784e5960

View File

@@ -8,11 +8,16 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends chromium curl \ && apt-get install -y --no-install-recommends chromium curl \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Use predefined node user (UID 1000, GID 1000)
# Set home directory ownership for node user
RUN usermod -d /fredy node
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \ ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
# Copy lockfiles first to leverage cache for dependencies # Copy lockfiles first to leverage cache for dependencies
COPY --chown=node:node package.json yarn.lock ./ COPY --chown=node:node package.json yarn.lock .
COPY package.json yarn.lock .
# Set Yarn timeout, install dependencies and PM2 globally # Set Yarn timeout, install dependencies and PM2 globally
RUN yarn config set network-timeout 600000 \ RUN yarn config set network-timeout 600000 \
@@ -21,12 +26,15 @@ RUN yarn config set network-timeout 600000 \
# Copy application source and build production assets # Copy application source and build production assets
COPY --chown=node:node . . COPY --chown=node:node . .
COPY . .
RUN yarn build:frontend RUN yarn build:frontend
# Prepare runtime directories and symlinks for data and config (as root) # Prepare runtime directories and symlinks for data and config
RUN mkdir -p /db /conf \ RUN mkdir -p /db /conf \
&& chown node:node /fredy /db /conf \ && chown -R node:node /fredy /db /conf \
&& chmod 770 /db /conf \ && chmod 755 /db /conf \
&& chown 1000:1000 /db /conf \
&& chmod 777 /db /conf \
&& ln -s /db /fredy/db \ && ln -s /db /fredy/db \
&& ln -s /conf /fredy/conf && ln -s /conf /fredy/conf
@@ -34,7 +42,7 @@ EXPOSE 9998
VOLUME /db VOLUME /db
VOLUME /conf VOLUME /conf
# Change to non-root user # Switch to non-root user
USER node USER node
# Start application using PM2 runtime # Start application using PM2 runtime