generated from product-os/balena-typescript-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (27 loc) · 932 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
ARG NODE_VERSION_MAJOR=16
FROM node:${NODE_VERSION_MAJOR}-alpine as build
WORKDIR /usr/src/app
COPY package.json ./
# Setup dependencies
RUN npm install
# Copy all files necessary for running the tests to the
# test stage
COPY tsconfig.json ./
COPY tsconfig.release.json ./
COPY lib ./lib
# Include the test directory in this stage
COPY tests ./tests
# Do not forget to copy mocha-pod config
COPY .mochapodrc.yml ./
# Set the environment variable globally to use
# this image for development of mocha-pod
ENV MOCHAPOD_SKIP_SETUP=1
FROM build as testing
# Comment the next line if you want to run the tests as a separate
# container instead of during the image build step.
# Make sure you also have set the `buildOnly` to `false` inside
# .mochapodrc.yml
RUN MOCHAPOD_SKIP_SETUP=1 npm run test:integration
# Test everything else for the CI tests
FROM testing as ci
RUN npm run test:unit && npm run build && npm run lint