refactor: remove non-root user and adjust file permissions for container compatibility
This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user