Skip to content

Commit

Permalink
Merge pull request #531 from Sorridi/main
Browse files Browse the repository at this point in the history
Refactor Dockerfile to run lavamusic as non-root user
  • Loading branch information
appujet authored Apr 6, 2024
2 parents 0c31b48 + 05d3fa1 commit 59aba39
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,14 @@ COPY --from=builder /opt/lavamusic/src/utils/LavaLogo.txt ./src/utils/LavaLogo.t
COPY package*.json ./
RUN npm install --only=production

# Run as non-root user
RUN addgroup --gid 322 --system lavamusic && \
adduser --uid 322 --system lavamusic

# Change ownership of the folder
RUN chown -R lavamusic:lavamusic /opt/lavamusic/

# Switch to the appropriate user
USER lavamusic

CMD [ "node", "dist/index.js" ]

0 comments on commit 59aba39

Please sign in to comment.