-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (29 loc) · 921 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
ARG node_version=16.20.2-alpine3.18
FROM node:${node_version} as base
RUN mkdir /opt/epp-encoda
WORKDIR /opt/epp-encoda
FROM base as build
# install packages needed to build node_modules
RUN apk add git python3 make gcc musl-dev g++
COPY package.json package.json
COPY yarn.lock yarn.lock
COPY .yarnrc.yml .yarnrc.yml
COPY .yarn/releases .yarn/releases
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
RUN yarn
FROM base as prod
COPY --from=build /opt/epp-encoda/node_modules node_modules
COPY --from=build /opt/epp-encoda/node_modules node_modules
COPY package.json package.json
COPY tsconfig.json tsconfig.json
COPY src/ src/
EXPOSE 3000
CMD [ "yarn", "start" ]
FROM prod as dev
CMD [ "yarn", "start:dev" ]
FROM prod as tests
COPY jest.config.ts jest.config.ts
COPY jest.config.integration.ts jest.config.integration.ts
COPY .eslintrc.js .eslintrc.js
COPY integration-tests integration-tests
CMD [ "yarn", "test" ]