-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-production
65 lines (50 loc) · 1.72 KB
/
Dockerfile-production
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Build:
# docker build -t owwwly/owwwly -f Dockerfile-production .
#
# Run:
# docker run -it owwwly/owwwly
#
# Compose:
# docker-compose -f docker-compose-production.yml up -d
FROM ubuntu:latest
MAINTAINER OWWWLY
# Install Utilities
RUN apt-get update -q && apt-get install -yqq aptitude git traceroute dnsutils tree tcpdump psmisc gcc make build-essential libfreetype6 libfontconfig libkrb5-dev curl sudo
# Install gem sass for grunt-contrib-sass
RUN apt-get install -y ruby
RUN gem install sass
# Install NodeJS
RUN curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
RUN sudo apt-get install -yq nodejs
# Install OWWWLY Prerequisites
RUN npm install --quiet -g grunt-cli gulp bower yo mocha karma-cli pm2
RUN mkdir /opt/owwwly.js
RUN mkdir -p /opt/owwwly.js/public/lib
WORKDIR /opt/owwwly.js
# Copies the local package.json file to the container
# and utilities docker container cache to not needing to rebuild
# and install node_modules/ everytime we build the docker, but only
# when the local package.json file changes.
# Install npm packages
ADD package.json /opt/owwwly.js/package.json
RUN npm install --quiet --production
# Install bower packages
ADD bower.json /opt/owwwly.js/bower.json
ADD .bowerrc /opt/owwwly.js/.bowerrc
RUN bower install --quiet --allow-root --config.interactive=false
# Share local directory on the docker container
ADD . /opt/owwwly.js
# Machine cleanup
RUN npm cache clean
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Set development environment as default
ENV NODE_ENV production
# Ports generic
EXPOSE 80:80
EXPOSE 443:443
# Port 3000 for OWWWLY server
EXPOSE 3000:3000
# Port 35729 for livereload
EXPOSE 35729:35729
# Run OWWWLY server
CMD ["npm","run-script","start:prod"]