-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
39 lines (29 loc) · 1.06 KB
/
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
FROM node:6.9.5
# Set environment variables.
ENV NODE_ENV development
ENV FRONTEND_APP_PATH "/usr/local/src/frontend"
ENV APP_USER "threeTornado"
ENV APP_USER_HOME "/home/threeTornado"
# Add the Application User to the container
RUN mkdir ${APP_USER_HOME} && \
groupadd -r ${APP_USER} -g 433 && \
useradd -u 431 -r -g ${APP_USER} -d ${APP_USER_HOME} -s /sbin/nologin -c "Docker image user" ${APP_USER} && \
chown -R ${APP_USER}:${APP_USER} ${APP_USER_HOME}
# basics
RUN apt-get update
RUN apt-get install -y openssl ruby-full
RUN npm install --global bower grunt-cli
RUN /bin/bash -l -c "gem install sass"
# Add the production application
ADD ./ ${FRONTEND_APP_PATH}
# Application user should own the app directory
RUN chown -R ${APP_USER}:${APP_USER} ${FRONTEND_APP_PATH}
WORKDIR ${FRONTEND_APP_PATH}
# install dependencies as the application user and build the application
USER threeTornado
RUN npm install
RUN bower install
# Application will be available at the following ports
EXPOSE 9000
# Run this command when the container starts
CMD ["grunt", "serve"]