-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (27 loc) · 1.06 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
FROM node:14.18.1-buster-slim AS prepare
WORKDIR /app
COPY packages ./packages
COPY package.json yarn.lock .yarnrc.yml lerna.json /prepared/
COPY .yarn /prepared/.yarn
RUN find packages -maxdepth 2 -mindepth 2 -name package.json -exec dirname /prepared/'{}' ';' | xargs mkdir -p && \
find packages -maxdepth 2 -mindepth 2 -name package.json -exec cp '{}' /prepared/'{}' ';'
FROM node:14.18.1-buster-slim AS build
WORKDIR /build
COPY --from=prepare /prepared ./
RUN yarn install --immutable
COPY . .
RUN mkdir -p /app/packages && \
yarn packall --out /app/packages/%s-v%v.tgz && \
cp -r yarn.lock .yarnrc.yml .yarn /app && \
yarn node scripts/make-docker-package-json.js /app/packages /app/package.json
WORKDIR /app
RUN yarn workspaces focus --production --all
FROM node:14.18.1-buster-slim AS run
WORKDIR /app
COPY --from=build /app/node_modules /app/node_modules
ENV NODE_ENV production
ENV RCTF_CONF_PATH /app/rctf.d
VOLUME /app/rctf.d
ENV PORT 80
EXPOSE 80
CMD ["node", "--enable-source-maps", "--unhandled-rejections=strict", "/app/node_modules/.bin/rctf"]