-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile.prod
60 lines (48 loc) · 1.83 KB
/
Dockerfile.prod
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
###############################################################################
# Dockerfile for Fracas. Inspired by https://github.com/docker-library/node.
###############################################################################
FROM node:4.8.3-slim
ENV BOWER_VERSION 1.7.9
MAINTAINER Miles Stewart, "https://github.com/sages-health"
RUN mkdir /code
WORKDIR /code
ADD bower.json package.json /code/
ADD po /code/po
ADD public /code/public
ADD server /code/server
ADD tasks /code/tasks
ADD views /code/views
ADD server.js gulpfile.js /code/
ADD config /code/config
# Some of this stuff is only needed for building, so we remove it when we're done
# Hopefully once Docker-in-Docker becomes easier we can build the app in a separate container and not have to
# worry about all the extra setup and tear down building inside the container entails
RUN buildDeps='autoconf ca-certificates curl git pkg-config build-essential bzip2'; \
set -x; \
apt-get -qq update && apt-get -qq install -y $buildDeps --no-install-recommends \
&& npm --silent update -g npm \
&& npm --silent install -g gulp bower@$BOWER_VERSION \
&& npm --silent install \
&& bower cache clean --allow-root \
&& bower install --allow-root \
&& bower cache clean --allow-root \
&& gulp build \
&& apt-get -qq clean -y \
&& apt-get -qq purge -y $buildDeps \
&& apt-get -qq autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& npm uninstall --silent -g gulp bower \
&& rm -rf /code/bower_components \
&& rm -rf /code/po \
&& rm -rf /code/public \
&& rm -rf /code/tasks \
&& rm -rf /code/views \
&& rm -f /code/bower.json \
&& rm -f /code/gulpfile.js
EXPOSE 9000 9001
ENV NODE_ENV production
ARG COMMIT_HASH
ENV COMMIT_HASH ${COMMIT_HASH}
ARG DEPLOY_DATE
ENV DEPLOY_DATE ${DEPLOY_DATE}
CMD ["node", "/code/server.js"]