forked from humanitec-tutorials/sample-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (26 loc) · 988 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
###############################################################################
# build environment #
###############################################################################
FROM node:10 as build
WORKDIR /app
COPY client/package*.json ./
RUN npm install
COPY client/ ./
RUN npm run build
RUN ls
###############################################################################
# deployable environment #
###############################################################################
FROM node:10 as deployable
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY server/package*.json ./
RUN npm install
# Bundle app source
COPY server/ ./
COPY --from=build /app/build/ /usr/src/app/public/
EXPOSE 8080
CMD [ "node", "./bin/www" ]