microsoft/TypeAgent
Publicmirrored fromhttps://github.com/microsoft/TypeAgentAvailable
ts/Dockerfile
93lines · modecode
| 1 | FROM node:20 AS base |
| 2 | |
| 3 | ENV PNPM_HOME="/pnpm" |
| 4 | ENV PATH="$PNPM_HOME:$PATH" |
| 5 | RUN npm install -g corepack@latest |
| 6 | RUN corepack enable pnpm |
| 7 | RUN corepack install -g pnpm@latest |
| 8 | |
| 9 | # dependencies |
| 10 | RUN apt-get update |
| 11 | RUN apt-get install -y libsecret-1-0 |
| 12 | RUN apt-get install -y libsecret-1-dev |
| 13 | RUN apt install -y gnome-keyring |
| 14 | RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash |
| 15 | |
| 16 | # Install dependencies required for Chrome/Puppeteer |
| 17 | RUN 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 |
| 42 | RUN 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 |
| 47 | FROM base AS build |
| 48 | COPY ./ /usr/src/app |
| 49 | WORKDIR /usr/src/app |
| 50 | RUN pnpm install --frozen-lockfile |
| 51 | RUN pnpm run -r build |
| 52 | RUN pnpm deploy --legacy --filter=agent-api --prod /prod/api |
| 53 | RUN pnpm deploy --legacy --filter=tools-scripts --prod /prod/tools |
| 54 | |
| 55 | # image with api and tool bits only |
| 56 | FROM base AS api |
| 57 | # api bits |
| 58 | COPY --from=build /prod/api/ /prod/api/ |
| 59 | COPY --from=build /prod/tools/ /prod/tools/ |
| 60 | # rendering bits |
| 61 | COPY --from=build /usr/src/app/packages/shell/out/ /prod/shell/out/ |
| 62 | WORKDIR /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 | |
| 80 | EXPOSE 80:3000 |
| 81 | |
| 82 | # start actions |
| 83 | # az login |
| 84 | RUN 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 |
| 88 | RUN echo node ../tools/scripts/getKeys.mjs >> start.sh |
| 89 | # start API server |
| 90 | RUN echo pnpm start >> start.sh |
| 91 | |
| 92 | # run start script |
| 93 | CMD ["bash", "start.sh"] |
| 94 | |