-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
41 lines (30 loc) · 875 Bytes
/
Dockerfile
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
# Use Ubuntu distribution
FROM ubuntu:14.04
MAINTAINER Ankit Sardesai <[email protected]>
# Install node and sqlite3 on Ubuntu
RUN apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
RUN apt-get update -y
RUN apt-get install -y nodejs nginx supervisor
# Install packages
ADD package.json /tmp/package.json
RUN cd /tmp && npm install
RUN mkdir -p /opt/app && cp -a /tmp/node_modules /opt/app/
# Copy application code
WORKDIR /opt/app
ADD . /opt/app
# Compile codebase
RUN npm run compile
# Prune developer packages and uncompiled files
RUN rm -rf app && npm prune --production
# Add hier directories to root
ADD hier /
# Add nginx user
RUN useradd -ms /bin/bash nginx
# Define environment variables
ENV NODE_ENV production
ENV PORT 5092
# Expose the port being used
EXPOSE 80
# Start the server
CMD ["/usr/bin/supervisord"]