diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fe76905 --- /dev/null +++ b/Dockerfile @@ -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