-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
59 lines (50 loc) · 2.11 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
ARG node_version=20.18-alpine3.19
FROM --platform=$BUILDPLATFORM node:${node_version} as build
RUN mkdir /opt/epp-client
WORKDIR /opt/epp-client
COPY ./ ./
RUN yarn
FROM --platform=$BUILDPLATFORM build as production_build
RUN yarn build
FROM --platform=$TARGETPLATFORM node:${node_version} as platform_deps
RUN mkdir /opt/epp-client
WORKDIR /opt/epp-client
COPY --from=build /opt/epp-client/.yarn/releases .yarn/releases
COPY --from=build /opt/epp-client/.yarn/cache .yarn/cache
COPY --from=build /opt/epp-client/.yarnrc.yml .yarnrc.yml
COPY --from=build /opt/epp-client/.env.yarn .env.yarn
COPY --from=build /opt/epp-client/.yarn/releases .yarn/releases
COPY --from=build /opt/epp-client/package.json package.json
COPY --from=build /opt/epp-client/yarn.lock yarn.lock
RUN yarn
FROM --platform=$TARGETPLATFORM node:${node_version} as production_deps
RUN mkdir /opt/epp-client
WORKDIR /opt/epp-client
COPY --from=build /opt/epp-client/.yarn/releases .yarn/releases
COPY --from=build /opt/epp-client/.yarn/cache .yarn/cache
COPY --from=build /opt/epp-client/.yarnrc.yml .yarnrc.yml
COPY --from=build /opt/epp-client/.env.yarn .env.yarn
COPY --from=build /opt/epp-client/.yarn/releases .yarn/releases
COPY --from=build /opt/epp-client/package.json package.json
COPY --from=build /opt/epp-client/yarn.lock yarn.lock
# RUN yarn
RUN yarn workspaces focus --production
FROM platform_deps as base
COPY ./ ./
FROM base as dev
CMD [ "yarn", "start:dev" ]
FROM --platform=$TARGETPLATFORM node:${node_version} as prod
RUN mkdir /opt/epp-client
WORKDIR /opt/epp-client
COPY --from=production_deps /opt/epp-client/node_modules /opt/epp-client/node_modules
COPY --from=production_deps /opt/epp-client/package.json /opt/epp-client/package.json
COPY --from=production_build /opt/epp-client/.next /opt/epp-client/.next
COPY --from=production_build /opt/epp-client/next.config.js /opt/epp-client/next.config.js
CMD [ "./node_modules/.bin/next", "start" ]
FROM mcr.microsoft.com/playwright:focal as browser-tests
WORKDIR /opt/tests
COPY package.json package.json
COPY yarn.lock yarn.lock
COPY playwright.config.ts playwright.config.ts
RUN yarn
CMD ["yarn", "test:browser"]