Skip to content

Commit

Permalink
Remove development stage
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevan-Y committed Mar 24, 2022
1 parent 131a3ee commit 9d0893d
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions src/api/sso/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,7 @@ ENV NPM_CONFIG_COLOR=false

RUN npm i -g pnpm

# We'll run the app as the `node` user, so put it in their home directory
WORKDIR /home/node/app

## Dependencies-dev ###############################################################
# Stage for installing dev dependencies
FROM base as dependencies-dev

COPY package.json ./

RUN pnpm install
WORKDIR /app

## Dependencies ###################################################################
# Stage for installing prod dependencies
Expand All @@ -27,26 +18,11 @@ COPY package.json ./

RUN pnpm install --prod

## Development #################################################################
# Define a development target that installs devDeps and runs in dev mode
FROM base as development
# Copy development node_modules from dependencies-dev
COPY --chown=node:node --from=dependencies-dev /home/node/app/node_modules ./node_modules

# Copy the source code over
COPY --chown=node:node . .

# Switch to the node user vs. root
USER node

# Start the app in debug mode so we can attach the debugger
CMD ["pnpm", "dev"]

## Deploy ######################################################################
# Stage for that run our app
FROM base as deploy
# Copy prodduction node_modules from dependencies
COPY --chown=node:node --from=dependencies /home/node/app/node_modules ./node_modules
COPY --chown=node:node --from=dependencies /app/node_modules ./node_modules

# Copy the source code
COPY --chown=node:node . .
Expand Down

0 comments on commit 9d0893d

Please sign in to comment.