Skip to content

Commit

Permalink
refactor Dockerfile to run lavamusic as non-root user
Browse files Browse the repository at this point in the history
  • Loading branch information
atom7xyz committed Apr 4, 2024
1 parent b7fb346 commit 05d3fa1
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 05d3fa1

Please sign in to comment.