Skip to content

Commit

Permalink
Optimize Dockerfile build stages
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirens committed Oct 29, 2021
1 parent 966065e commit 2449f64
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
FROM node:lts-alpine

RUN npm install -g http-server
WORKDIR /app

COPY package*.json ./
RUN npm ci

COPY . .
RUN npm run lint && npm run build

RUN npm ci
RUN npm run build
RUN npm install -g http-server

ENV PORT 8000
EXPOSE $PORT

EXPOSE 8080
CMD [ "http-server", "dist" ]
CMD http-server dist -p "$PORT" -d false -i false

0 comments on commit 2449f64

Please sign in to comment.