blob: e0551ddd16fa4c4b45759882ac247d5b7adb43ac [file] [log] [blame]
Matteo Scandolod819c922016-12-02 14:06:14 -08001# To build use: docker build -t xosproject/xos-gui .
2# To run use: docker run -p 80:80 -d xosproject/xos-gui
3
4FROM nginx
5
6# Set environment vars
7ENV CODE_SOURCE .
8ENV CODE_DEST /var/www
9ENV VHOST /usr/share/nginx/html
10
11# Install nodeJs
12RUN apt-get update
13RUN apt-get install curl git -y
14RUN curl -sL https://deb.nodesource.com/setup_4.x > install_node.sh
15RUN chmod a+x install_node.sh
16RUN ./install_node.sh
17RUN apt-get install -y nodejs
18
19# Add the app
20COPY ${CODE_SOURCE} ${CODE_DEST}
21
22# Build the app
23WORKDIR ${CODE_DEST}
24RUN npm install
25RUN npm run build
26
27# Move the builded code to nginx vhost
28RUN mv ${CODE_DEST}/dist/* ${VHOST}