blob: 1e33e62a49e568fbdfe0148db306f5b9d2682e55 [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
Matteo Scandolo3b3b3b42016-12-15 17:31:53 -08009ENV VHOST /var/www/dist
Matteo Scandolod819c922016-12-02 14:06:14 -080010
11# Install nodeJs
12RUN apt-get update
Matteo Scandolo9f87f302016-12-13 18:11:10 -080013RUN apt-get install curl git bzip2 -y
Matteo Scandolod819c922016-12-02 14:06:14 -080014RUN 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
Matteo Scandolof4b85172017-01-11 09:56:02 -080022# Install Deps
Matteo Scandolod819c922016-12-02 14:06:14 -080023WORKDIR ${CODE_DEST}
24RUN npm install
Matteo Scandolod819c922016-12-02 14:06:14 -080025
Matteo Scandolo3b3b3b42016-12-15 17:31:53 -080026# Override nginx configutaion
Matteo Scandolof4b85172017-01-11 09:56:02 -080027RUN mkdir -p /var/log/nginx/log
Matteo Scandolod62ea792016-12-22 14:02:28 -080028RUN mv ${CODE_SOURCE}/nginx.conf /etc/nginx/conf.d/default.conf
Matteo Scandolof4b85172017-01-11 09:56:02 -080029
30# Build the app
31EXPOSE 4000
32RUN npm run build