File size: 1,054 Bytes
7931a43
a45f02e
 
9fd1dfc
a45f02e
 
3fe1d62
a45f02e
 
 
34d42e2
 
a0dfe7b
a45f02e
436d3be
a0dfe7b
436d3be
3fe1d62
a45f02e
3fe1d62
 
 
 
 
 
 
c26e117
3fe1d62
 
 
 
 
 
 
 
a45f02e
 
3fe1d62
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
FROM node:20 AS build

# 添加 git,以便之后能从GitHub克隆项目
RUN apt install git

# 从 GitHub 克隆项目到 /app 目录下
RUN git clone https://github.com/yokingma/search_with_ai.git /app
COPY ./logo.png /app/web/src/assets/logo.png
COPY ./logo.png /app/web/src/public/favicon.ico
COPY ./home.vue /app/web/src/pages/home.vue
COPY ./toolbar.vue /app/web/src/components/toolbar.vue
COPY ./constant.ts /app/backend/constant.ts
COPY ./app.ts /app/backend/app.ts

WORKDIR /app
RUN yarn install && yarn add axios && yarn run build

WORKDIR /app/web
RUN yarn install && yarn run build

FROM node:20-alpine
WORKDIR /app

# Install dotenvx
RUN curl -fsS https://dotenvx.sh/ | sh

COPY .env /app

COPY --from=build /app/dist ./dist
COPY --from=build /app/backend ./backend
COPY --from=build /app/web/build ./web/build
COPY --from=build /app/package.json ./

# RUN yarn config set registry https://mirrors.cloud.tencent.com/npm/
RUN yarn install --production && yarn cache clean

EXPOSE 3000
CMD yarn run start