mirror of
https://github.com/The-Art-of-Hacking/h4cker.git
synced 2024-12-23 14:29:31 -05:00
24 lines
421 B
Docker
24 lines
421 B
Docker
|
### First Stage ###
|
||
|
# Base Image
|
||
|
FROM node:12-slim as build
|
||
|
WORKDIR /usr/src/app
|
||
|
|
||
|
# Install Dependencies
|
||
|
COPY package*.json ./
|
||
|
RUN npm install
|
||
|
|
||
|
# Copy in the application we created
|
||
|
COPY . .
|
||
|
|
||
|
### Second Stage ###
|
||
|
FROM gcr.io/distroless/nodejs:12
|
||
|
|
||
|
# Copy App + Dependencies from Build Stage
|
||
|
COPY --from=build /usr/src/app /usr/src/app
|
||
|
WORKDIR /usr/src/app
|
||
|
|
||
|
# Set User to Non-Root
|
||
|
USER 1000
|
||
|
|
||
|
# Run Server
|
||
|
CMD [ "server.js" ]
|