microsoft/TypeAgent

Public

mirrored fromhttps://github.com/microsoft/TypeAgentAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
b9ae73e8c13f9df3b5d8951fd682f55f20ae9678

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

ts/Dockerfile

93lines · modecode

1FROM node:20 AS base
2
3ENV PNPM_HOME="/pnpm"
4ENV PATH="$PNPM_HOME:$PATH"
5RUN npm install -g corepack@latest
6RUN corepack enable pnpm
7RUN corepack install -g pnpm@latest
8
9# dependencies
10RUN apt-get update
11RUN apt-get install -y libsecret-1-0
12RUN apt-get install -y libsecret-1-dev
13RUN apt install -y gnome-keyring
14RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash
15
16# Install dependencies required for Chrome/Puppeteer
17RUN apt-get update && apt-get install -y \
18 wget \
19 gnupg \
20 ca-certificates \
21 procps \
22 libxss1 \
23 libgconf-2-4 \
24 libatk1.0-0 \
25 libatk-bridge2.0-0 \
26 libgdk-pixbuf2.0-0 \
27 libgtk-3-0 \
28 libgbm-dev \
29 libnss3-dev \
30 libxss-dev \
31 fonts-liberation \
32 libappindicator3-1 \
33 libasound2 \
34 libdbus-1-3 \
35 libnspr4 \
36 libxcomposite1 \
37 libxdamage1 \
38 libxrandr2 \
39 xdg-utils
40
41# Install Chrome for Puppeteer
42RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
43 && apt-get install -y ./google-chrome-stable_current_amd64.deb \
44 && rm google-chrome-stable_current_amd64.deb
45
46# base only image
47FROM base AS build
48COPY ./ /usr/src/app
49WORKDIR /usr/src/app
50RUN pnpm install --frozen-lockfile
51RUN pnpm run -r build
52RUN pnpm deploy --legacy --filter=agent-api --prod /prod/api
53RUN pnpm deploy --legacy --filter=tools-scripts --prod /prod/tools
54
55# image with api and tool bits only
56FROM base AS api
57# api bits
58COPY --from=build /prod/api/ /prod/api/
59COPY --from=build /prod/tools/ /prod/tools/
60# rendering bits
61COPY --from=build /usr/src/app/packages/shell/out/ /prod/shell/out/
62WORKDIR /prod/api
63
64######################################### BLOB STORAGE MOUNT #########################################
65## blobfuse - https://github.com/Azure/azure-storage-fuse/tree/main
66## Uncomment the section below to use blobfuse to mount blob storage
67#RUN apt-get update \
68# && apt-get install -y wget apt-utils \
69# && wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb \
70# && dpkg -i packages-microsoft-prod.deb \
71# && apt-get update \
72# && apt-get install -y libfuse3-dev fuse3 libcurl3-gnutls libgnutls30
73#
74#RUN apt-get install -y blobfuse2
75#COPY --from=build /usr/src/app/mount-blobfuse.yaml ./mount-blobfuse.yaml
76#RUN mkdir /mnt/blob
77#RUN mkdir /blob-cache
78######################################################################################################
79
80EXPOSE 80:3000
81
82# start actions
83# az login
84RUN echo az login --identity >> start.sh
85## mount blob storage locally
86#RUN echo blobfuse2 mount /mnt/blob --config-file=mount-blobfuse.yaml >> start.sh
87# run getKeys
88RUN echo node ../tools/scripts/getKeys.mjs >> start.sh
89# start API server
90RUN echo pnpm start >> start.sh
91
92# run start script
93CMD ["bash", "start.sh"]
94