Created
March 2, 2020 20:58
-
-
Save djmason9/b704ea1f38a931d49f156005eaeba478 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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