Skip to content

Instantly share code, notes, and snippets.

@djmason9
Created March 2, 2020 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djmason9/b704ea1f38a931d49f156005eaeba478 to your computer and use it in GitHub Desktop.
Save djmason9/b704ea1f38a931d49f156005eaeba478 to your computer and use it in GitHub Desktop.
# See the README.md for usage and configuration info
# This line defines which node.js Docker image to leverage
# Available versions are described at https://hub.docker.com/_/node/
FROM node:8-alpine
# Sets the default working directory to /app which is where we copy the service files to.
WORKDIR /app
# TODO: for security purposes, you should update this Dockerfile to specify your own target user/group
# -S stands for '--system'
# -G stands for group
# -R changes the ownership rights of a file recursively
RUN addgroup -S axway-group && adduser -S axway-user -G axway-group && \
chown -R axway-user:axway-group /app
# Set non-root user
USER axway-user
# Denotes to copy all files in the service to 'app' folder in the container
COPY --chown=axway-user:axway-group . /app
# Install service dependencies relevant for production builds skipping all development dependencies.
RUN npm install --production --no-optional
# Starts the service
CMD ["node", "."]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment