File size: 575 Bytes
c9f953b bf17451 90825f3 9c0f270 c9f953b bf17451 ae25738 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
FROM node:20-slim
WORKDIR /app
COPY . /app
RUN ls -al /app
RUN mkdir config
COPY w_env.ts /app/server/env.ts
# 将当前目录下的所有文件复制到工作目录
#ENV NODE_ENV=production
RUN npm install
RUN --mount=type=secret,id=API_KEY,mode=0444,required=true \
echo "GOOGLE_API_KEY=$(cat /run/secrets/API_KEY)" > /app/config/.env
#RUN cat /app/config/.env
RUN chmod -R 777 /app/node_modules/
#RUN npm run build
# Start the server by default, this can be overwritten at runtime
EXPOSE 3000
#ENV GOOGLE_API_KEY=$(cat /run/secrets/API_KEY)
CMD ["npm", "run", "dev"]
|