-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
30 lines (28 loc) · 1.05 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
#FROM node:8-alpine as builder
#WORKDIR /usr/src/app
#COPY package.json package-lock.json ./
#RUN npm install
#COPY . .
#RUN $(npm bin)/ng build --target=production --environment=prod --aot=false
#
#FROM nginx:1.13.12
#WORKDIR /var/RareCODE-WebApp/
#COPY --from=builder /usr/src/app/dist .
#RUN rm /etc/nginx/conf.d/default.conf
#ADD app.conf /etc/nginx/nginx.conf
#RUN echo "Asia/Shanghai" > /etc/timezone && rm /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
#EXPOSE 80
FROM nginx:1.13.12
WORKDIR /usr/src/app
RUN apt-get update && apt-get install -y curl build-essential && curl -sL https://deb.nodesource.com/setup_9.x | bash -
RUN apt-get install -y nodejs && rm -rf /var/lib/apt/lists/* && npm install yarn -y
COPY package.json package-lock.json ./
RUN yarn add
COPY . .
RUN yarn build
WORKDIR /var/app/
RUN cp -r /usr/src/app/build/* . && rm -rf /usr/src/app/
RUN rm /etc/nginx/conf.d/default.conf
ADD app.conf /etc/nginx/nginx.conf
RUN echo "Asia/Shanghai" > /etc/timezone && rm /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
EXPOSE 80