forked from openhab/openhab-cloud
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (42 loc) · 1.29 KB
/
Copy pathDockerfile
File metadata and controls
54 lines (42 loc) · 1.29 KB
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
FROM mhart/alpine-node:7.10.1
# File Author / Maintainer
MAINTAINER Mehmet Arziman
RUN apk update && \
apk upgrade && \
apk add --no-cache build-base && \
apk add --no-cache python
RUN addgroup -S openhabcloud && \
adduser -H -S -g openhabcloud openhabcloud
# Add proper timezone
RUN apk add --no-cache tzdata && \
cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime && \
echo "Europe/Berlin" > /etc/timezone
# Cleanup container
RUN rm -rf \
/usr/share/man \
/tmp/* /var/cache/apk/* \
/root/.npm \
/root/.node-gyp \
/root/.gnupg \
/usr/lib/node_modules/npm/man \
/usr/lib/node_modules/npm/doc \
/usr/lib/node_modules/npm/html \
/usr/lib/node_modules/npm/scripts
RUN mkdir -p /opt/openhabcloud/logs
RUN mkdir /data
COPY ./package.json /opt/openhabcloud/
RUN ln -s /opt/openhabcloud/package.json /data
WORKDIR /data
RUN npm install && npm rebuild bcrypt --build-from-source
ENV NODE_PATH /data/node_modules
ADD . /opt/openhabcloud
RUN rm -Rf /opt/openhabcloud/deployment
RUN rm -Rf /opt/openhabcloud/docs
RUN rm -Rf /opt/openhabcloud/tests
RUN rm /opt/openhabcloud/config-development.json
RUN rm /opt/openhabcloud/config-production.json
RUN chown openhabcloud: /opt/openhabcloud/logs
WORKDIR /opt/openhabcloud
USER openhabcloud
EXPOSE 3000
CMD ["node", "app.js"]