-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile.test
122 lines (88 loc) · 2.73 KB
/
Dockerfile.test
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
FROM thinxcloud/base:alpine
LABEL maintainer="Matej Sychra <[email protected]>"
LABEL name="THiNX API" version="1.9.2578"
ARG DEBIAN_FRONTEND=noninteractive
ARG THINX_HOSTNAME
ENV THINX_HOSTNAME=${THINX_HOSTNAME}
ARG THINX_OWNER_EMAIL
ENV THINX_OWNER_EMAIL=${THINX_OWNER_EMAIL}
ARG COUCHDB_USER
ENV COUCHDB_USER=${COUCHDB_USER}
ARG COUCHDB_PASS
ENV COUCHDB_PASS=${COUCHDB_PASS}
ARG REDIS_PASSWORD
ENV REDIS_PASSWORD=${REDIS_PASSWORD}
ARG CODACY_PROJECT_TOKEN
ENV CODACY_PROJECT_TOKEN=${CODACY_PROJECT_TOKEN}
ARG ROLLBAR_ACCESS_TOKEN
ENV ROLLBAR_ACCESS_TOKEN=${ROLLBAR_ACCESS_TOKEN}
ARG ROLLBAR_ENVIRONMENT
ARG ROLLBAR_ENVIRONMENT=${ROLLBAR_ENVIRONMENT}
ARG AQUA_SEC_TOKEN
ENV AQUA_SEC_TOKEN=${AQUA_SEC_TOKEN}
ARG SNYK_TOKEN
ENV SNYK_TOKEN=${SNYK_TOKEN}
ARG ENVIRONMENT
ENV ENVIRONMENT=${ENVIRONMENT}
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
ARG REVISION
ENV REVISION=${REVISION}
ARG GOOGLE_OAUTH_ID
ENV GOOGLE_OAUTH_ID=${GOOGLE_OAUTH_ID}
ARG GOOGLE_OAUTH_SECRET
ENV GOOGLE_OAUTH_SECRET=${GOOGLE_OAUTH_SECRET}
ARG GITHUB_CLIENT_ID
ENV GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID}
ARG GITHUB_CLIENT_SECRET
ENV GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET}
ARG GITHUB_ACCESS_TOKEN
ENV GITHUB_ACCESS_TOKEN={GITHUB_ACCESS_TOKEN}
ARG SLACK_BOT_TOKEN
ENV SLACK_BOT_TOKEN=${SLACK_BOT_TOKEN}
ARG SLACK_CLIENT_ID
ENV SLACK_CLIENT_ID=${SLACK_CLIENT_ID}
ARG SLACK_CLIENT_SECRET
ENV SLACK_CLIENT_SECRET=${SLACK_CLIENT_SECRET}
ARG SLACK_WEBHOOK
ENV SLACK_WEBHOOK=${SLACK_WEBHOOK}
ARG GITHUB_SECRET
ENV GITHUB_SECRET=${GITHUB_SECRET}
ARG ENTERPRISE
ENV ENTERPRISE=${ENTERPRISE}
ARG WORKER_SECRET
ENV WORKER_SECRET=${WORKER_SECRET}
ARG CIRCLE_NODE_TOTAL
ENV CIRCLE_NODE_TOTAL=${CIRCLE_NODE_TOTAL}
ARG CIRCLE_NODE_INDEX
ENV CIRCLE_NODE_INDEX=${CIRCLE_NODE_INDEX}
ARG NODE_COVERALLS_DEBUG
ENV NODE_COVERALLS_DEBUG=0
# Create app directory
WORKDIR /opt/thinx/thinx-device-api
# Install test dependencies
RUN apk add openjdk8-jre p7zip
# Install app dependencies
COPY package.json ./
RUN npm install -g [email protected] \
&& npm install .
VOLUME /var/lib/docker
# THiNX Web & Device API (HTTP)
EXPOSE 7442
# THiNX Device API (HTTPS)
EXPOSE 7443
# GitLab Webbook
EXPOSE 9002
# Copy app source code
COPY . .
RUN mkdir -p ./.nyc_output
# only for test mocking (may not work, will need structure with mock data in repo)
COPY ./spec/mnt /mnt
# download test reporter as a static binary
RUN curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
RUN chmod +x ./cc-test-reporter
# Test modules
RUN npm install -g nyc mocha jasmine mocha-lcov-reporter coveralls
# TODO: Implement Snyk Container Scanning here in addition to DockerHub manual scans...
COPY ./docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT [ "/docker-entrypoint.sh" ]