-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.integration
More file actions
35 lines (29 loc) · 969 Bytes
/
Copy pathDockerfile.integration
File metadata and controls
35 lines (29 loc) · 969 Bytes
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
FROM owezzy/docker-node-env:v10 as builder
# project variables
ENV SRC_DIR /usr/src
ENV GIT_REPO https://github.com/owezzy/soko-bora.git
ENV SRC_CODE_LOCATION .
ENV BUILD_SCRIPT build:prod
# get source code
RUN mkdir -p $SRC_DIR
WORKDIR $SRC_DIR
# if necessary, do SSH setup here or copy source code from local or CI environment
RUN git clone $GIT_REPO .
COPY $SRC_CODE_LOCATION .
RUN npm install
RUN npm run $BUILD_SCRIPT
# testing enviroment config
FROM slapers/alpine-node-chromium as tester
ENV BUILDER_SRC_DIR /usr/src
ENV SRC_DIR /usr/src
ENV TEST_SCRIPT test:prod
ENV TEST_COVERAGE test:coverage
ENV TEST_COVERAGE_REPORT posttest:coverage
RUN mkdir -p $SRC_DIR
WORKDIR $SRC_DIR
COPY --from=builder $BUILDER_SRC_DIR $SRC_DIR
CMD ['npm run $TEST_SCRIPT','npm run $TEST_COVERAGE', 'npm run $TEST_COVERAGE_REPORT']
FROM duluca/minimal-nginx-web-server:1.13.8-alpine
ENV BUILDER_SRC_DIR /usr/src
COPY --from=builder $BUILDER_SRC_DIR/dist /var/www
CMD ['nginx']