forked from IROTRAS/NFLPickem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
51 lines (36 loc) · 1.08 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
####################
### build client ###
####################
# Create image based on official Node 8 image from dockerhub
FROM node:8 AS builder
# Create new directory to place app
RUN mkdir -p /app
# Change directory so our commands run inside the newly created directory
WORKDIR /app
# Copy dependecy definitions
COPY NFL-Pickem /app
# Install dependecies
RUN npm install
# generate build
RUN npm run build
# RUN ng build --prod --configuration=producton output-path=dist
####################
### server ###
####################
# Create image based on official Node 8 image from dockerhub
FROM node:8
# Create new directory to place app and public for the client dist
RUN mkdir -p /usr/src/app
RUN mkdir -p /usr/src/app/public
# Change directory so our commands run inside the newly created directory
WORKDIR /usr/src/app
# Copy dependecy definitions
COPY . /usr/src/app
# Install dependecies
RUN npm install
# copy from the build
COPY --from=builder /app/dist /usr/src/app/public
# Expose the port for app
EXPOSE 3200
# Use the Start script to serve the app
CMD ["npm", "start"]