Spaces:
Build error
Build error
Colab User commited on
Commit ·
9472cc8
1
Parent(s): 71f35dd
Initial commit: Deploy rasa-engine API server
Browse files- Dockerfile +12 -10
Dockerfile
CHANGED
|
@@ -10,24 +10,26 @@ RUN npm install -g pnpm
|
|
| 10 |
# Copy root package.json and pnpm-workspace.yaml
|
| 11 |
COPY package.json pnpm-workspace.yaml ./
|
| 12 |
|
| 13 |
-
# Copy
|
| 14 |
-
# This includes artifacts, lib, and scripts as defined in pnpm-workspace.yaml
|
| 15 |
-
COPY artifacts artifacts/
|
| 16 |
COPY lib lib/
|
| 17 |
|
| 18 |
-
# Install dependencies for
|
| 19 |
-
|
| 20 |
-
RUN pnpm install --no-frozen-lockfile
|
| 21 |
|
| 22 |
# Run codegen for @workspace/api-spec to generate @workspace/api-zod
|
| 23 |
-
# This assumes orval.config.ts generates the API client into a location
|
| 24 |
-
# that pnpm can find within the workspace (e.g., artifacts/api-zod).
|
| 25 |
RUN pnpm --filter=@workspace/api-spec run codegen
|
| 26 |
|
| 27 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
RUN pnpm install --no-frozen-lockfile
|
| 29 |
|
| 30 |
-
# Build the api-server project.
|
| 31 |
RUN pnpm run build --filter=@workspace/api-server
|
| 32 |
|
| 33 |
# Expose the port the app runs on
|
|
|
|
| 10 |
# Copy root package.json and pnpm-workspace.yaml
|
| 11 |
COPY package.json pnpm-workspace.yaml ./
|
| 12 |
|
| 13 |
+
# Copy lib/ to ensure @workspace/api-spec and its dependencies (like orval) are available
|
|
|
|
|
|
|
| 14 |
COPY lib lib/
|
| 15 |
|
| 16 |
+
# Install dependencies for @workspace/api-spec to run codegen
|
| 17 |
+
RUN pnpm install --filter=@workspace/api-spec --no-frozen-lockfile
|
|
|
|
| 18 |
|
| 19 |
# Run codegen for @workspace/api-spec to generate @workspace/api-zod
|
|
|
|
|
|
|
| 20 |
RUN pnpm --filter=@workspace/api-spec run codegen
|
| 21 |
|
| 22 |
+
# Now copy the 'artifacts' directory. By this point, 'artifacts/api-zod' should have been
|
| 23 |
+
# generated by the previous step within the container's filesystem.
|
| 24 |
+
# This COPY will also bring in 'artifacts/api-server' from the build context.
|
| 25 |
+
# This order ensures `artifacts/api-zod` is present when the full install runs.
|
| 26 |
+
COPY artifacts artifacts/
|
| 27 |
+
|
| 28 |
+
# Perform a full pnpm install to link all workspace packages (including the newly generated
|
| 29 |
+
# @workspace/api-zod and @workspace/api-server) and install all external dependencies.
|
| 30 |
RUN pnpm install --no-frozen-lockfile
|
| 31 |
|
| 32 |
+
# Build the api-server project.
|
| 33 |
RUN pnpm run build --filter=@workspace/api-server
|
| 34 |
|
| 35 |
# Expose the port the app runs on
|