microsoft/TypeAgent

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
0e14bf1757edbf3f99d30f3f5d91a032e9d8c4ec

Branches

Tags

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

Clone

HTTPS

Download ZIP

ts/Dockerfile

89lines · modecode

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