Created
September 8, 2017 12:52
-
-
Save 0x8801/59977bc42ff1a7a51e3e383113997842 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM nginx:latest | |
RUN apt-get update && \ | |
apt-get install -y sudo curl bzip2 wget git vim gnupg | |
RUN curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash - | |
RUN sudo apt-get -y install build-essential | |
RUN sudo apt-get -y install nodejs | |
RUN sudo apt-get clean | |
# forward request and error logs to docker log collector | |
RUN ln -sf /dev/stdout /var/log/nginx/access.log && \ | |
ln -sf /dev/stderr /var/log/nginx/error.log | |
COPY ./nginx.conf /etc/nginx/conf.d/ | |
RUN mkdir /build && mkdir /app | |
WORKDIR /build | |
COPY . /build/ | |
RUN npm install && npm run build | |
RUN cp ./nginx.conf /etc/nginx/conf.d/default.conf && \ | |
cp -R /build/dist/* /app/ && \ | |
rm -fr /build | |
WORKDIR /app | |
CMD ["nginx", "-g", "daemon off;"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment