reverting docker file changes, adding script to test things locally

This commit is contained in:
orangecoding
2025-10-02 09:37:01 +02:00
parent c151f4f76e
commit 9dd3947cb7
2 changed files with 22 additions and 11 deletions

View File

@@ -8,15 +8,11 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends chromium curl \
&& 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 \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
# Copy lockfiles first to leverage cache for dependencies
COPY --chown=node:node package.json yarn.lock .
COPY package.json yarn.lock .
# Set Yarn timeout, install dependencies and PM2 globally
RUN yarn config set network-timeout 600000 \
@@ -24,13 +20,13 @@ RUN yarn config set network-timeout 600000 \
&& yarn global add pm2
# Copy application source and build production assets
COPY --chown=node:node . .
COPY . .
RUN yarn build:frontend
# Prepare runtime directories and symlinks for data and config
RUN mkdir -p /db /conf \
&& chown -R node:node /fredy /db /conf \
&& chmod 755 /db /conf \
&& chown 1000:1000 /db /conf \
&& chmod 777 /db /conf \
&& ln -s /db /fredy/db \
&& ln -s /conf /fredy/conf
@@ -38,8 +34,5 @@ EXPOSE 9998
VOLUME /db
VOLUME /conf
# Switch to non-root user
USER node
# Start application using PM2 runtime
CMD ["pm2-runtime", "index.js"]