forked from microsoft/BotFramework-Composer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (48 loc) · 1.84 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
#################
#
# Because Composer is organized as a monorepo with multiple packages
# managed by yarn workspaces, our Dockerfile may not look like other
# node / react projects. Specifically, we have to add all source files
# before doing yarn install due to yarn workspace symlinking.
#
################
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-focal as base
RUN apt update \
&& apt -y install curl dirmngr apt-transport-https lsb-release ca-certificates \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt install -y nodejs libgomp1 \
&& npm install -g yarn
FROM base as build
ARG YARN_ARGS
WORKDIR /src/Composer
COPY ./Composer .
COPY ./extensions ../extensions
# run yarn install as a distinct layer
RUN yarn install --frozen-lock-file $YARN_ARGS
ENV NODE_OPTIONS "--max-old-space-size=6114"
ENV NODE_ENV "production"
ENV COMPOSER_BUILTIN_EXTENSIONS_DIR "/src/extensions"
RUN yarn build:prod $YARN_ARGS
# CI only
ENV COMPOSER_REMOTE_EXTENSIONS_DIR "/src/remote-extensions"
ENV COMPOSER_REMOTE_EXTENSION_DATA_DIR "/src/extension-data"
ENV COMPOSER_EXTENSION_MANIFEST "/src/extensions.json"
CMD ["yarn","start:server"]
FROM base as composerbasic
ARG YARN_ARGS
WORKDIR /app/Composer
COPY --from=build /src/Composer/yarn.lock .
COPY --from=build /src/Composer/package.json .
COPY --from=build /src/Composer/packages ./packages
COPY --from=build /src/extensions ../extensions
ENV NODE_ENV "production"
RUN yarn --production --frozen-lockfile --force $YARN_ARGS && yarn cache clean
FROM base
ENV NODE_ENV "production"
WORKDIR /app/Composer
COPY --from=composerbasic /app ..
ENV COMPOSER_BUILTIN_EXTENSIONS_DIR "/app/extensions"
ENV COMPOSER_REMOTE_EXTENSIONS_DIR "/app/remote-extensions"
ENV COMPOSER_REMOTE_EXTENSION_DATA_DIR "/app/extension-data"
ENV COMPOSER_EXTENSION_MANIFEST "/app/extensions.json"
CMD ["yarn","start:server"]