blob: 3fef3f026846e8b856b6a4b4cbff1c6fbf559d4b [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
Matteo Scandolo37d65092017-01-12 12:03:05 -080019# Add the app deps
20COPY ${CODE_SOURCE}/package.json ${CODE_DEST}/package.json
21COPY ${CODE_SOURCE}/typings.json ${CODE_DEST}/typings.json
Matteo Scandolod819c922016-12-02 14:06:14 -080022
Matteo Scandolof4b85172017-01-11 09:56:02 -080023# Install Deps
Matteo Scandolod819c922016-12-02 14:06:14 -080024WORKDIR ${CODE_DEST}
Matteo Scandolo37d65092017-01-12 12:03:05 -080025RUN npm install
Matteo Scandoloe1bc8a02017-01-11 15:35:11 -080026RUN npm run typings
Matteo Scandolod819c922016-12-02 14:06:14 -080027
Matteo Scandolo37d65092017-01-12 12:03:05 -080028# Create folder for logs
Matteo Scandolof4b85172017-01-11 09:56:02 -080029RUN mkdir -p /var/log/nginx/log
Matteo Scandolof4b85172017-01-11 09:56:02 -080030
31# Build the app
32EXPOSE 4000
Matteo Scandolo37d65092017-01-12 12:03:05 -080033COPY ${CODE_SOURCE}/conf ${CODE_DEST}/conf
34COPY ${CODE_SOURCE}/gulp_tasks ${CODE_DEST}/gulp_tasks
35COPY ${CODE_SOURCE}/src ${CODE_DEST}/src
36COPY ${CODE_SOURCE}/gulpfile.js ${CODE_DEST}/gulpfile.js
37COPY ${CODE_SOURCE}/tsconfig.json ${CODE_DEST}/tsconfig.json
38COPY ${CODE_SOURCE}/tslint.json ${CODE_DEST}/tslint.json
39RUN npm run build
40
41# Override nginx configutaion
42COPY ${CODE_SOURCE}/nginx.conf ${CODE_DEST}/nginx.conf
43RUN mv ${CODE_SOURCE}/nginx.conf /etc/nginx/conf.d/default.conf