Skip to content

Commit

Permalink
add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Kopei authored May 20, 2019
1 parent e6a1a6d commit ff81369
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,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

0 comments on commit ff81369

Please sign in to comment.