Created
December 16, 2017 01:55
-
-
Save condef5/4791c9bc03426134b162ced1f59d39cd to your computer and use it in GitHub Desktop.
Tiis - Cuarto Entregable
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
# Image from node | |
FROM node:7 | |
# Global install yarn package manager | |
RUN apt-get update && apt-get install -y curl apt-transport-https && \ | |
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ | |
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ | |
apt-get update && apt-get install -y yarn | |
# Install Nginx | |
RUN apt-get install -y nginx | |
RUN mkdir /etc/nginx/logs && touch /etc/nginx/logs/static.log | |
# Establecer el directorio de trabajo | |
WORKDIR /opt/app | |
ENV NODE_ENV production | |
# Copiamos el codigo en la carpeta app | |
COPY . . | |
# Instalamos las dependencias | |
RUN yarn install | |
RUN yarn build | |
RUN cp -r build/. /usr/share/nginx/html | |
RUN rm -r /opt/app | |
ADD ./nginx.conf /etc/nginx/sites-available/default | |
EXPOSE 80 | |
CMD ["nginx", "-g", "daemon off;"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment