microsoft/TypeAgent

Public

mirrored from https://github.com/microsoft/TypeAgentAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
4bcdfe170d1a3344dad8bc0b09ce05b25acbd089

Branches

Tags

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

Clone

HTTPS

Download ZIP

ts/Dockerfile

90lines · modecode

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