update: backend Dockerfile

pull/536/head
Paul 6 years ago
parent 43ea897bd8
commit 6ea733547c

@ -1,5 +1,23 @@
FROM node:8.11.1-alpine
# BUILDING
FROM node:lts-alpine AS builder
LABEL maintainer="llitfkitfk@gmail.com"
RUN npm install -g typescript
WORKDIR /app
# cache dependencies
COPY package.json ./
RUN npm install
# build
COPY . ./
RUN npm run build
# RUNNING
FROM node:lts-alpine
LABEL maintainer="llitfkitfk@gmail.com"
WORKDIR /app
ADD . /tmp
RUN /bin/sh -c 'cd /tmp && npm install && npm install -g typescript && npm run build && mv ./dist/* /app/ && mv ./node_modules /app/ && rm -rf /tmp'
COPY --from=builder /app/dist/* ./
COPY --from=builder /app/node_modules ./node_modules
Loading…
Cancel
Save