Skip to content

Instantly share code, notes, and snippets.

@aryan9600
Created December 19, 2020 10:52
Show Gist options
  • Save aryan9600/57639e967ede021d8e7ba257d8abf717 to your computer and use it in GitHub Desktop.
Save aryan9600/57639e967ede021d8e7ba257d8abf717 to your computer and use it in GitHub Desktop.
FROM node:alpine
WORKDIR '/app'
COPY ./package.json ./
RUN npm install
COPY . .
# Add a user group with a group ID of 1001
RUN addgroup -g 1001 ctf
# Add a user with a user ID of 1001 and to the ctf user group
RUN adduser -u 1001 ctf -G ctf
# Set permissions to revoke write access
RUN chmod 555 /app
# Set default user for container
USER ctf
EXPOSE 2640
CMD ["node", "app.js"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment