From 68aefb4cd1a65fea7485e7abbfca3bf633ad8b5e Mon Sep 17 00:00:00 2001 From: Anton Voylenko Date: Mon, 2 Jun 2025 15:28:09 +0300 Subject: [PATCH] fix: rollback docker user --- Dockerfile | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index a7ce3b0..a950abf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,29 +16,21 @@ RUN npm ci --only=production --ignore-scripts # Create the final stage FROM base -# Install system dependencies and create wwebjs user +# Install system dependencies RUN apt-get update && \ apt-get install -y --no-install-recommends \ fonts-freefont-ttf \ chromium \ ffmpeg && \ apt-get clean && \ - rm -rf /var/lib/apt/lists/* && \ - # Create wwebjs user and group with home directory - groupadd -r wwebjs && \ - useradd -r -g wwebjs -m -d /home/wwebjs -s /bin/bash wwebjs && \ - # Give ownership of the working directory to wwebjs user - chown -R wwebjs:wwebjs /usr/src/app + rm -rf /var/lib/apt/lists/* # Copy only production dependencies from deps stage COPY --from=deps /usr/src/app/node_modules ./node_modules # Copy application code -COPY --chown=wwebjs:wwebjs . . +COPY . . EXPOSE 3000 -# Use wwebjs user for better security -USER wwebjs - CMD ["npm", "start"]