-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile.dev
executable file
·65 lines (48 loc) · 1.83 KB
/
Dockerfile.dev
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
###############################################################################
# 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/
# 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 build-essential ca-certificates curl git libjpeg-dev libpng-dev pkg-config python'; \
phantomDeps='libfreetype6 libfontconfig1'; \
set -x; \
apt-get update && apt-get install -y $buildDeps $phantomDeps --no-install-recommends
RUN npm update -g npm \
&& npm install -g gulp bower@$BOWER_VERSION \
&& npm install
RUN bower install --allow-root \
&& bower cache clean --allow-root \
&& rm -rf /var/lib/apt/lists/*
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 .git /code/.git
RUN gulp build \
&& npm prune --production \
&& npm uninstall -g gulp bower \
&& npm cache clear \
&& apt-get clean -y \
&& apt-get purge -y $buildDeps \
&& apt-get autoremove -y \
&& 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 \
&& rm -rf /code/.git
ADD config /code/config
EXPOSE 9000 9001
ENV NODE_ENV production
CMD ["node", "/code/server.js"]