refactor: remove non-root user and adjust file permissions for container compatibility

This commit is contained in:
2025-12-26 23:59:18 +01:00
parent 7e958db51c
commit 9c77a4b935
2 changed files with 4 additions and 9 deletions

View File

@@ -21,19 +21,14 @@ RUN mkdir -p /app/config /app/data/pdfs
# Crée le fichier projects.json
COPY config/projects.json.example /app/config/projects.json
# Crée un utilisateur non-root pour la sécurité
RUN addgroup -g 1001 -S nodejs && \
adduser -S botuser -u 1001
# Change la propriété des fichiers
RUN chown -R botuser:nodejs /app
USER botuser
# Ajuste les permissions pour être plus permissives
RUN chmod -R 777 /app/config
# Définit les variables d'environnement par défaut
ENV NODE_ENV=production
ENV LOG_LEVEL=info
# Commande de démarrage
# Commande de démarrage (en tant que root)
CMD ["node", "src/index.js"]
# Labels pour la documentation