orztv commited on
Commit
27bd649
·
1 Parent(s): 9752ba4
Files changed (1) hide show
  1. Dockerfile +10 -4
Dockerfile CHANGED
@@ -1,3 +1,6 @@
 
 
 
1
  FROM node:20-bullseye-slim AS base
2
  ENV PNPM_HOME="/pnpm"
3
  ENV PATH="$PNPM_HOME:$PATH"
@@ -16,13 +19,16 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
16
  RUN pnpm deploy --filter=@imput/cobalt-api --prod /prod/api
17
 
18
  FROM base AS api
 
 
 
 
 
 
19
  WORKDIR /app
20
 
21
  COPY --from=build /prod/api /app
22
  COPY --from=build /app/.git /app/.git
23
 
24
- # 复制.env.example并重命名为.env
25
- COPY .env.example .env
26
-
27
- EXPOSE 9000
28
  CMD [ "node", "src/cobalt" ]
 
1
+ ARG API_URL=https://your-api-url.com
2
+ ARG API_PORT=7860
3
+
4
  FROM node:20-bullseye-slim AS base
5
  ENV PNPM_HOME="/pnpm"
6
  ENV PATH="$PNPM_HOME:$PATH"
 
19
  RUN pnpm deploy --filter=@imput/cobalt-api --prod /prod/api
20
 
21
  FROM base AS api
22
+
23
+ ENV API_URL=$API_URL
24
+ ENV API_PORT=$API_PORT
25
+ ENV API_NAME=local
26
+ ENV CORS_WILDCARD=0
27
+
28
  WORKDIR /app
29
 
30
  COPY --from=build /prod/api /app
31
  COPY --from=build /app/.git /app/.git
32
 
33
+ EXPOSE $API_PORT
 
 
 
34
  CMD [ "node", "src/cobalt" ]