Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 1 | # To build use: docker build -t xosproject/xos-gui . |
| 2 | # To run use: docker run -p 80:80 -d xosproject/xos-gui |
| 3 | |
| 4 | FROM nginx |
| 5 | |
| 6 | # Set environment vars |
| 7 | ENV CODE_SOURCE . |
| 8 | ENV CODE_DEST /var/www |
Matteo Scandolo | 3b3b3b4 | 2016-12-15 17:31:53 -0800 | [diff] [blame] | 9 | ENV VHOST /var/www/dist |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 10 | |
| 11 | # Install nodeJs |
| 12 | RUN apt-get update |
Matteo Scandolo | 9f87f30 | 2016-12-13 18:11:10 -0800 | [diff] [blame] | 13 | RUN apt-get install curl git bzip2 -y |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 14 | RUN curl -sL https://deb.nodesource.com/setup_4.x > install_node.sh |
| 15 | RUN chmod a+x install_node.sh |
| 16 | RUN ./install_node.sh |
| 17 | RUN apt-get install -y nodejs |
| 18 | |
| 19 | # Add the app |
| 20 | COPY ${CODE_SOURCE} ${CODE_DEST} |
| 21 | |
Matteo Scandolo | f4b8517 | 2017-01-11 09:56:02 -0800 | [diff] [blame] | 22 | # Install Deps |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 23 | WORKDIR ${CODE_DEST} |
| 24 | RUN npm install |
Matteo Scandolo | e1bc8a0 | 2017-01-11 15:35:11 -0800 | [diff] [blame] | 25 | RUN npm run typings |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 26 | |
Matteo Scandolo | 3b3b3b4 | 2016-12-15 17:31:53 -0800 | [diff] [blame] | 27 | # Override nginx configutaion |
Matteo Scandolo | f4b8517 | 2017-01-11 09:56:02 -0800 | [diff] [blame] | 28 | RUN mkdir -p /var/log/nginx/log |
Matteo Scandolo | d62ea79 | 2016-12-22 14:02:28 -0800 | [diff] [blame] | 29 | RUN mv ${CODE_SOURCE}/nginx.conf /etc/nginx/conf.d/default.conf |
Matteo Scandolo | f4b8517 | 2017-01-11 09:56:02 -0800 | [diff] [blame] | 30 | |
| 31 | # Build the app |
| 32 | EXPOSE 4000 |
| 33 | RUN npm run build |