forked from linode/apl-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (27 loc) · 853 Bytes
/
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
40
FROM otomi/tools:v1.4.25 as test
ENV APP_HOME=/home/app/stack
RUN mkdir -p $APP_HOME
WORKDIR $APP_HOME
ARG SKIP_TESTS='false'
ENV CI=true
ENV ENV_DIR=$APP_HOME/env
ENV IN_DOCKER='1'
ENV VERBOSITY='2'
COPY --chown=app . .
RUN npm config set update-notifier false
RUN npm ci --ignore-scripts && npm run compile
RUN if [ "$SKIP_TESTS" = 'false' ]; then ln -s $APP_HOME/tests/fixtures env && npm test && rm $APP_HOME/env; fi
#-----------------------------
FROM otomi/tools:v1.4.25 as prod
ENV APP_HOME=/home/app/stack
ENV ENV_DIR=/home/app/stack/env
ENV IN_DOCKER='1'
ENV VERBOSITY='0'
ENV NODE_NO_WARNINGS='1'
RUN npm config set update-notifier false
RUN mkdir -p $APP_HOME
WORKDIR $APP_HOME
COPY --from=test /home/app/stack/dist /home/app/stack/dist
COPY --chown=app . .
RUN npm install --production --ignore-scripts
CMD ["dist/src/otomi.js"]