-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile
42 lines (32 loc) · 1.1 KB
/
dockerfile
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
39
40
41
42
FROM node:20-alpine AS build
WORKDIR /app
COPY package*.json ./
# COPY .env.local ./
RUN npm config set registry https://registry.npmmirror.com/
RUN npm ci
ENV PYTHON_ENV='cd /app && source ./venv/bin/activate &&'
# 安装 python-shell npm 包
# RUN npm install python-shell
COPY . .
RUN npm run build
FROM build
WORKDIR /app
# 替换软件源并安装 python3 和 pip
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
apk update && \
apk add --no-cache python3 py3-pip
# 创建和激活虚拟环境,然后安装 edge-tts
RUN python3 -m venv venv && \
./venv/bin/pip install --upgrade edge-tts
ENV PYTHON_ENV='cd /app && source ./venv/bin/activate &&'
# # 安装 python-shell npm 包
# RUN npm install python-shell
COPY --from=build /app/.next ./.next
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/package.json ./package.json
COPY --from=build /app/.env ./.env
COPY --from=build /app/audio_cache ./audio_cache
# 安装 python-shell npm 包
RUN npm config set registry https://registry.npmmirror.com/
EXPOSE 3000
CMD ["npm", "start"]