@molecule/api-staging-docker-compose 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  Apache License
2
3
  Version 2.0, January 2004
3
4
  http://www.apache.org/licenses/
@@ -34,21 +35,33 @@
34
35
 
35
36
  "Work" shall mean the work of authorship, whether in Source or
36
37
  Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work.
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
38
40
 
39
41
  "Derivative Works" shall mean any work, whether in Source or Object
40
42
  form, that is based on (or derived from) the Work and for which the
41
43
  editorial revisions, annotations, elaborations, or other modifications
42
- represent, as a whole, an original work of authorship.
43
-
44
- "Contribution" shall mean any work of authorship, including the
45
- original version of the Work and any modifications or additions
46
- to that Work, that is intentionally submitted to the Licensor for
47
- inclusion in the Work by the copyright owner or by an individual or
48
- Legal Entity authorized to submit on behalf of the copyright owner.
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
49
62
 
50
63
  "Contributor" shall mean Licensor and any individual or Legal Entity
51
- on behalf of whom a Contribution has been received by the Licensor and
64
+ on behalf of whom a Contribution has been received by Licensor and
52
65
  subsequently incorporated within the Work.
53
66
 
54
67
  2. Grant of Copyright License. Subject to the terms and conditions of
@@ -61,8 +74,18 @@
61
74
  3. Grant of Patent License. Subject to the terms and conditions of
62
75
  this License, each Contributor hereby grants to You a perpetual,
63
76
  worldwide, non-exclusive, no-charge, royalty-free, irrevocable
64
- patent license to make, have made, use, offer to sell, sell, import,
65
- and otherwise transfer the Work.
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
66
89
 
67
90
  4. Redistribution. You may reproduce and distribute copies of the
68
91
  Work or Derivative Works thereof in any medium, with or without
@@ -84,23 +107,87 @@
84
107
  (d) If the Work includes a "NOTICE" text file as part of its
85
108
  distribution, then any Derivative Works that You distribute must
86
109
  include a readable copy of the attribution notices contained
87
- within such NOTICE file.
88
-
89
- 5. Submission of Contributions.
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
90
138
 
91
139
  6. Trademarks. This License does not grant permission to use the trade
92
- names, trademarks, service marks, or product names of the Licensor.
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
93
143
 
94
144
  7. Disclaimer of Warranty. Unless required by applicable law or
95
- agreed to in writing, Licensor provides the Work on an "AS IS" BASIS,
96
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND.
97
-
98
- 8. Limitation of Liability. In no event and under no legal theory shall
99
- any Contributor be liable to You for damages.
100
-
101
- 9. Accepting Warranty or Additional Liability.
102
-
103
- Copyright 2026 Molecule Dev, Inc.
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
104
191
 
105
192
  Licensed under the Apache License, Version 2.0 (the "License");
106
193
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -3,21 +3,21 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
3
  Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
4
  Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
5
  To change this document, edit the module-level JSDoc in src/index.ts.
6
- Generated: 2026-08-04T01:49:36.498Z
6
+ Generated: 2026-10-23T11:44:04.664Z
7
7
  -->
8
8
 
9
9
  # @molecule/api-staging-docker-compose
10
10
 
11
- > **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
12
- > It is written to be read by coding agents as much as by people, and is generated from this
13
- > package's source — edit `src/index.ts` JSDoc, not this file.
14
-
15
11
  Docker Compose staging driver for molecule.dev.
16
12
 
17
13
  Manages ephemeral staging environments using Docker Compose.
18
14
  Each feature branch gets isolated API, App, and database containers
19
15
  with unique port allocations and networking.
20
16
 
17
+ > **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
18
+ > It is written to be read by coding agents as much as by people, and is generated from this
19
+ > package's source — edit `src/index.ts` JSDoc, not this file.
20
+
21
21
  ## Quick Start
22
22
 
23
23
  ```typescript
@@ -27,6 +27,17 @@ import { provider } from '@molecule/api-staging-docker-compose'
27
27
  setProvider(provider)
28
28
  ```
29
29
 
30
+ ```typescript
31
+ import { generateApiDeploymentArtifacts } from '@molecule/api-staging-docker-compose'
32
+
33
+ const files = generateApiDeploymentArtifacts({
34
+ runtimeDirectory: 'api',
35
+ runtimePaths: ['api', 'app/dist'],
36
+ runtimeCommand: ['node', 'dist/server.js'],
37
+ })
38
+ // Ordinary Dockerfile/dockerignore/build script; caller owns file writes and hosting.
39
+ ```
40
+
30
41
  ## Type
31
42
 
32
43
  `provider`
@@ -41,18 +52,6 @@ npm install @molecule/api-staging-docker-compose @molecule/api-staging
41
52
 
42
53
  ### Interfaces
43
54
 
44
- #### `ComposeContainerStatus`
45
-
46
- A single service row parsed from `docker compose ps --format json`.
47
-
48
- ```typescript
49
- interface ComposeContainerStatus {
50
- Service: string
51
- State: string
52
- Health: string
53
- }
54
- ```
55
-
56
55
  #### `ComposeGeneratorConfig`
57
56
 
58
57
  Configuration for Docker Compose file generation.
@@ -79,78 +78,59 @@ interface ComposeGeneratorConfig {
79
78
  }
80
79
  ```
81
80
 
82
- ### Functions
83
-
84
- #### `containerStatus(container)`
85
-
86
- Returns the human-readable status for a parsed `docker compose ps`
87
- container row — the `Health` value when a healthcheck is defined,
88
- otherwise the raw container `State`, or `'not found'` when the service
89
- isn't running at all.
90
-
91
- ```typescript
92
- function containerStatus(container?: ComposeContainerStatus): string
93
- ```
94
-
95
- - `container` — The parsed container row, or `undefined` if the service wasn't found.
96
-
97
- **Returns:** The status string.
98
-
99
- #### `fallbackPort(base, slug, range)`
81
+ #### `ComposeContainerStatus`
100
82
 
101
- Deterministically derives a fallback host port from an environment slug so
102
- that TWO environments falling back to this path (no `driverMeta` — direct
103
- provider callers only; `mlcl stage up` always allocates real ports via
104
- `allocatePort()`) don't collide on the SAME fixed port. Uses FNV-1a, a
105
- stable, dependency-free 32-bit hash — the same slug always maps to the same
106
- port across repeated `up()` calls, so redeploying an existing slug doesn't
107
- relocate it.
83
+ A single service row parsed from `docker compose ps --format json`.
108
84
 
109
85
  ```typescript
110
- function fallbackPort(base: number, slug: string, range?: number): number
86
+ interface ComposeContainerStatus {
87
+ Service: string
88
+ State: string
89
+ Health: string
90
+ }
111
91
  ```
112
92
 
113
- - `base` — The base port for this role (api/app/db).
114
- - `slug` — The environment slug to derive an offset from.
115
- - `range` — Width of the offset window (default 100 — kept narrow enough that api/app/db's offset windows never overlap each other).
116
-
117
- **Returns:** `base` plus a slug-derived offset in `[0, range)`.
118
-
119
- #### `generateApiDockerfile()`
120
-
121
- Generates a multi-stage Dockerfile for the API server.
93
+ #### `ApiDeploymentArtifactOptions`
122
94
 
123
- Stage 1 (build): installs all deps, compiles TypeScript.
124
- Stage 2 (runtime): copies compiled output, installs production deps only.
95
+ Explicit project facts used to generate a native-compatible Node deployment.
125
96
 
126
97
  ```typescript
127
- function generateApiDockerfile(): string
98
+ interface ApiDeploymentArtifactOptions {
99
+ /** One Debian/apt-based image for build and runtime; an immutable digest is supported. */
100
+ nodeImage?: string
101
+ /** Build command as argv, executed after npm ci with install scripts enabled. */
102
+ buildCommand?: readonly string[]
103
+ /** Server command as argv, executed without a shell. */
104
+ runtimeCommand?: readonly string[]
105
+ /** Output paths to carry. For workspaces, include the server workspace and frontend output. */
106
+ runtimePaths?: readonly string[]
107
+ /** Server working directory relative to the build context root. */
108
+ runtimeDirectory?: string
109
+ /** Additional Debian build prerequisites, beyond Python/make/C++. */
110
+ buildPackages?: readonly string[]
111
+ /** Additional Debian runtime libraries/tools. */
112
+ runtimePackages?: readonly string[]
113
+ /** Exposed container port; does not configure a hosting provider. */
114
+ port?: number
115
+ }
128
116
  ```
129
117
 
130
- **Returns:** Dockerfile content as a string.
118
+ #### `ApiDeploymentArtifacts`
131
119
 
132
- #### `generateAppDockerfile(envVars)`
133
-
134
- Generates a multi-stage Dockerfile for the frontend app.
135
-
136
- Stage 1 (build): installs deps, injects Vite env vars via Docker ARG,
137
- then runs the Vite build. ARG → ENV ensures \`process.env.VITE_*\` is
138
- available to Vite at build time (takes precedence over .env files).
139
-
140
- Stage 2 (serve): copies built static assets into Nginx. The nginx.conf is
141
- copied from the \`staging\` named build context (the \`.molecule/staging/\`
142
- directory, wired via \`additional_contexts\` in the generated compose file) —
143
- NOT from the app build context: the app project has no nginx.conf of its
144
- own, so a plain \`COPY nginx.conf\` would fail every build with
145
- "not found in build context".
120
+ Ordinary project files; callers own their write/merge policy for existing files.
146
121
 
147
122
  ```typescript
148
- function generateAppDockerfile(envVars?: Record<string, string>): string
123
+ interface ApiDeploymentArtifacts {
124
+ /** Self-contained multi-stage Dockerfile; does not depend on the external build script. */
125
+ Dockerfile: string
126
+ /** The identical POSIX install/build/prune body embedded in the Dockerfile. */
127
+ '.molecule/deploy/build.sh': string
128
+ /** Build-context exclusions for host modules, old output and local secrets. */
129
+ '.dockerignore': string
130
+ }
149
131
  ```
150
132
 
151
- - `envVars` — Build-time environment variables to inject (e.g. \`{ VITE_API_URL: '...' }\`).
152
-
153
- **Returns:** Dockerfile content as a string.
133
+ ### Functions
154
134
 
155
135
  #### `generateComposeFile(env, config)`
156
136
 
@@ -186,6 +166,71 @@ function generateComposeFile(env: StagingEnvironment, config: ComposeGeneratorCo
186
166
 
187
167
  **Returns:** A Docker Compose YAML string.
188
168
 
169
+ #### `generateApiDeploymentArtifacts(options)`
170
+
171
+ Generate ordinary deployment files for a Node package or npm workspace root.
172
+ Uses the project's lockfile, standard npm lifecycle scripts, a native build
173
+ toolchain and npm prune. Build and runtime use the same Node/libc image;
174
+ runtime copies the built modules instead of reinstalling without a compiler.
175
+ Native dependencies are built for the Docker target, never the host's modules.
176
+
177
+ ```typescript
178
+ function generateApiDeploymentArtifacts({
179
+ nodeImage = NODE_DEPLOYMENT_IMAGE,
180
+ buildCommand = ['npm', 'run', 'build'],
181
+ runtimeCommand = ['node', 'dist/server.js'],
182
+ runtimePaths = ['dist'],
183
+ runtimeDirectory = '.',
184
+ buildPackages = [],
185
+ runtimePackages = [],
186
+ port = 4000,
187
+ }?: ApiDeploymentArtifactOptions): ApiDeploymentArtifacts
188
+ ```
189
+
190
+ - `options` — Layout, commands and system dependencies supplied by the caller.
191
+
192
+ **Returns:** A self-contained Dockerfile, paired dockerignore and identical build script.
193
+
194
+ #### `generateApiDockerfile(options)`
195
+
196
+ Generates a multi-stage Dockerfile for the API server.
197
+
198
+ Uses generateApiDeploymentArtifacts, including its native install toolchain
199
+ and matching build/runtime image. The paired ignore is available from that
200
+ function; callers using another Dockerfile name should write it alongside
201
+ that Dockerfile as <Dockerfile-name>.dockerignore.
202
+
203
+ ```typescript
204
+ function generateApiDockerfile(options?: ApiDeploymentArtifactOptions): string
205
+ ```
206
+
207
+ - `options` — Explicit build/runtime facts; defaults preserve the package layout.
208
+
209
+ **Returns:** Dockerfile content as a string.
210
+
211
+ #### `generateAppDockerfile(envVars)`
212
+
213
+ Generates a multi-stage Dockerfile for the frontend app.
214
+
215
+ Stage 1 (build): installs deps, injects Vite env vars via Docker ARG,
216
+ then runs the Vite build. ARG → ENV ensures \`process.env.VITE_*\` is
217
+ available to Vite at build time (takes precedence over .env files).
218
+
219
+ Stage 2 (serve): copies built static assets into Nginx. The nginx.conf is
220
+ copied from the \`staging\` named build context (the \`.molecule/staging/\`
221
+ directory, wired via \`additional_contexts\` in the generated compose file) —
222
+ NOT from the app build context: the app project has no nginx.conf of its
223
+ own, so a plain \`COPY nginx.conf\` would fail every build with
224
+ "not found in build context".
225
+
226
+ ```typescript
227
+ function generateAppDockerfile(envVars?: Record<string, string>): string
228
+ ```
229
+
230
+ - `envVars` — Build-time environment variables to inject (e.g. \`{ VITE_API_URL: '...' }\`).
231
+
232
+ **Returns:** Dockerfile content as a string.
233
+
189
234
  #### `generateNginxConf()`
190
235
 
191
236
  Generates an SPA-compatible Nginx configuration.
@@ -199,6 +244,21 @@ function generateNginxConf(): string
199
244
 
200
245
  **Returns:** Nginx config content as a string.
201
246
 
247
+ #### `parseComposeVersion(output)`
248
+
249
+ Parses a major.minor pair out of `docker compose version` output (e.g.
250
+ `'Docker Compose version v2.24.5'` or the bare `'2.24.5'` from `--short`).
251
+ Exported for testing — no need to shell out to `docker` to verify the
252
+ parsing logic against every version-string shape Compose has printed.
253
+
254
+ ```typescript
255
+ function parseComposeVersion(output: string): { major: number; minor: number } | null
256
+ ```
257
+
258
+ - `output` — Raw stdout from `docker compose version`.
259
+
260
+ **Returns:** The parsed `{ major, minor }`, or `null` if no version substring is found.
261
+
202
262
  #### `isComposeVersionSufficient(version)`
203
263
 
204
264
  Checks a parsed Compose version against {@link REQUIRED_COMPOSE_VERSION}.
@@ -211,6 +271,26 @@ function isComposeVersionSufficient(version: { major: number; minor: number }):
211
271
 
212
272
  **Returns:** `true` if the version meets or exceeds the minimum this driver requires.
213
273
 
274
+ #### `fallbackPort(base, slug, range)`
275
+
276
+ Deterministically derives a fallback host port from an environment slug so
277
+ that TWO environments falling back to this path (no `driverMeta` — direct
278
+ provider callers only; `mlcl stage up` always allocates real ports via
279
+ `allocatePort()`) don't collide on the SAME fixed port. Uses FNV-1a, a
280
+ stable, dependency-free 32-bit hash — the same slug always maps to the same
281
+ port across repeated `up()` calls, so redeploying an existing slug doesn't
282
+ relocate it.
283
+
284
+ ```typescript
285
+ function fallbackPort(base: number, slug: string, range?: number): number
286
+ ```
287
+
288
+ - `base` — The base port for this role (api/app/db).
289
+ - `slug` — The environment slug to derive an offset from.
290
+ - `range` — Width of the offset window (default 100 — kept narrow enough that api/app/db's offset windows never overlap each other).
291
+
292
+ **Returns:** `base` plus a slug-derived offset in `[0, range)`.
293
+
214
294
  #### `isContainerHealthy(container)`
215
295
 
216
296
  Determines whether a parsed `docker compose ps` container row counts as
@@ -231,23 +311,31 @@ function isContainerHealthy(container?: ComposeContainerStatus): boolean
231
311
 
232
312
  **Returns:** `true` if the container is healthy.
233
313
 
234
- #### `parseComposeVersion(output)`
314
+ #### `containerStatus(container)`
235
315
 
236
- Parses a major.minor pair out of `docker compose version` output (e.g.
237
- `'Docker Compose version v2.24.5'` or the bare `'2.24.5'` from `--short`).
238
- Exported for testing — no need to shell out to `docker` to verify the
239
- parsing logic against every version-string shape Compose has printed.
316
+ Returns the human-readable status for a parsed `docker compose ps`
317
+ container row — the `Health` value when a healthcheck is defined,
318
+ otherwise the raw container `State`, or `'not found'` when the service
319
+ isn't running at all.
240
320
 
241
321
  ```typescript
242
- function parseComposeVersion(output: string): { major: number; minor: number } | null
322
+ function containerStatus(container?: ComposeContainerStatus): string
243
323
  ```
244
324
 
245
- - `output` — Raw stdout from `docker compose version`.
325
+ - `container` — The parsed container row, or `undefined` if the service wasn't found.
246
326
 
247
- **Returns:** The parsed `{ major, minor }`, or `null` if no version substring is found.
327
+ **Returns:** The status string.
248
328
 
249
329
  ### Constants
250
330
 
331
+ #### `NODE_DEPLOYMENT_IMAGE`
332
+
333
+ Default compatible Node/libc base, shared by build and runtime stages.
334
+
335
+ ```typescript
336
+ const NODE_DEPLOYMENT_IMAGE: 'node:22.23.4-trixie-slim'
337
+ ```
338
+
251
339
  #### `provider`
252
340
 
253
341
  Docker Compose staging driver implementation.
@@ -285,6 +373,19 @@ Peer dependencies:
285
373
 
286
374
  - `@molecule/api-staging`
287
375
 
376
+ - API artifacts use a patched Node 22 Debian base and build native modules
377
+ with Python/make/C++. Install lifecycle scripts run with project source
378
+ present; dev dependencies are pruned before built modules move into the
379
+ matching, nonroot runtime. No second production install recompiles native
380
+ modules without tools. Use the generated dockerignore to exclude host
381
+ node_modules and local secrets. For a workspace root, explicitly carry its
382
+ server workspace (including manifests/nested dependencies) and frontend
383
+ output. Extra system libraries and alternative apt-based images are caller
384
+ configuration; native compatibility must be verified on the target platform.
385
+ - Artifact generation is pure: it starts no container, infers no database or
386
+ route and overwrites no project file. The Compose provider uses these files
387
+ for its existing separate API/App contexts; other deployment callers can
388
+ use the same generator without adopting Compose's service topology.
288
389
  - Requires Docker Compose v2.24+ and BuildKit: the generated compose file
289
390
  uses long-syntax `env_file` (`required: false` — a project without `.env`
290
391
  or `.env.staging` must still stage) and a named `additional_contexts`
@@ -76,7 +76,7 @@ services:
76
76
  db:
77
77
  condition: service_healthy
78
78
  healthcheck:
79
- test: ["CMD-SHELL", "wget -qO- http://localhost:4000/health || exit 1"]
79
+ test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:4000/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]
80
80
  interval: 5s
81
81
  timeout: 5s
82
82
  retries: 5
@@ -7,15 +7,43 @@
7
7
  *
8
8
  * @module
9
9
  */
10
+ import type { ApiDeploymentArtifactOptions, ApiDeploymentArtifacts } from './types.js';
11
+ /** Default compatible Node/libc base, shared by build and runtime stages. */
12
+ export declare const NODE_DEPLOYMENT_IMAGE = "node:22.23.4-trixie-slim";
13
+ /**
14
+ * Generate ordinary deployment files for a Node package or npm workspace root.
15
+ * Uses the project's lockfile, standard npm lifecycle scripts, a native build
16
+ * toolchain and npm prune. Build and runtime use the same Node/libc image;
17
+ * runtime copies the built modules instead of reinstalling without a compiler.
18
+ * Native dependencies are built for the Docker target, never the host's modules.
19
+ *
20
+ * @param options - Layout, commands and system dependencies supplied by the caller.
21
+ * @returns A self-contained Dockerfile, paired dockerignore and identical build script.
22
+ * @example
23
+ * ```typescript
24
+ * import { generateApiDeploymentArtifacts } from '@molecule/api-staging-docker-compose'
25
+ *
26
+ * const files = generateApiDeploymentArtifacts({
27
+ * runtimeDirectory: 'api',
28
+ * runtimePaths: ['api', 'app/dist'],
29
+ * runtimeCommand: ['node', 'dist/server.js'],
30
+ * })
31
+ * // Inspect/merge files into the project; preserve existing user-owned artifacts.
32
+ * ```
33
+ */
34
+ export declare function generateApiDeploymentArtifacts({ nodeImage, buildCommand, runtimeCommand, runtimePaths, runtimeDirectory, buildPackages, runtimePackages, port, }?: ApiDeploymentArtifactOptions): ApiDeploymentArtifacts;
10
35
  /**
11
36
  * Generates a multi-stage Dockerfile for the API server.
12
37
  *
13
- * Stage 1 (build): installs all deps, compiles TypeScript.
14
- * Stage 2 (runtime): copies compiled output, installs production deps only.
38
+ * Uses generateApiDeploymentArtifacts, including its native install toolchain
39
+ * and matching build/runtime image. The paired ignore is available from that
40
+ * function; callers using another Dockerfile name should write it alongside
41
+ * that Dockerfile as <Dockerfile-name>.dockerignore.
15
42
  *
43
+ * @param options - Explicit build/runtime facts; defaults preserve the package layout.
16
44
  * @returns Dockerfile content as a string.
17
45
  */
18
- export declare function generateApiDockerfile(): string;
46
+ export declare function generateApiDockerfile(options?: ApiDeploymentArtifactOptions): string;
19
47
  /**
20
48
  * Generates a multi-stage Dockerfile for the frontend app.
21
49
  *
@@ -1 +1 @@
1
- {"version":3,"file":"dockerfile-generator.d.ts","sourceRoot":"","sources":["../src/dockerfile-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAiB9C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GAAG,MAAM,CAuBlF;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAmB1C"}
1
+ {"version":3,"file":"dockerfile-generator.d.ts","sourceRoot":"","sources":["../src/dockerfile-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,4BAA4B,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AAEtF,6EAA6E;AAC7E,eAAO,MAAM,qBAAqB,6BAA6B,CAAA;AAwD/D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,8BAA8B,CAAC,EAC7C,SAAiC,EACjC,YAAsC,EACtC,cAA2C,EAC3C,YAAuB,EACvB,gBAAsB,EACtB,aAAkB,EAClB,eAAoB,EACpB,IAAW,GACZ,GAAE,4BAAiC,GAAG,sBAAsB,CAqE5D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,4BAAiC,GAAG,MAAM,CAExF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GAAG,MAAM,CAuBlF;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAmB1C"}
@@ -7,31 +7,155 @@
7
7
  *
8
8
  * @module
9
9
  */
10
+ /** Default compatible Node/libc base, shared by build and runtime stages. */
11
+ export const NODE_DEPLOYMENT_IMAGE = 'node:22.23.4-trixie-slim';
10
12
  /**
11
- * Generates a multi-stage Dockerfile for the API server.
13
+ * Quote a literal shell argument.
14
+ * @param value - A string argument.
15
+ * @returns Its literal POSIX shell form.
16
+ */
17
+ function quote(value) {
18
+ return `'${value.replaceAll("'", "'\"'\"'")}'`;
19
+ }
20
+ /**
21
+ * Render a command without shell expansion.
22
+ * @param argv - Command arguments.
23
+ * @returns A literal command.
24
+ */
25
+ function command(argv) {
26
+ if (!Array.isArray(argv) ||
27
+ !argv.length ||
28
+ !argv[0] ||
29
+ argv.some((value) => typeof value !== 'string' || /[\0\r\n]/.test(value)))
30
+ throw new Error('Commands must be nonempty arrays of single-line string arguments');
31
+ return argv.map(quote).join(' ');
32
+ }
33
+ /**
34
+ * Validate a path inside the build context.
35
+ * @param value - A build-context path.
36
+ * @returns A relative path without traversal.
37
+ */
38
+ function relativePath(value) {
39
+ if (typeof value !== 'string' ||
40
+ !/^[a-zA-Z0-9_.-]+(?:\/[a-zA-Z0-9_.-]+)*$/.test(value) ||
41
+ value.split('/').some((part) => part === '..'))
42
+ throw new Error('Artifact paths must be relative paths without traversal or substitutions');
43
+ return value;
44
+ }
45
+ /**
46
+ * Render standard apt installation commands.
47
+ * @param packages - Debian package names.
48
+ * @returns Standard apt installation commands.
49
+ */
50
+ function aptInstall(packages) {
51
+ if (packages.some((value) => typeof value !== 'string' || !/^[a-z0-9][a-z0-9+.-]*$/.test(value))) {
52
+ throw new Error('System packages must be Debian package names');
53
+ }
54
+ return `apt-get update\napt-get install -y --no-install-recommends ${packages.map(quote).join(' ')}\nrm -rf /var/lib/apt/lists/*`;
55
+ }
56
+ /**
57
+ * Generate ordinary deployment files for a Node package or npm workspace root.
58
+ * Uses the project's lockfile, standard npm lifecycle scripts, a native build
59
+ * toolchain and npm prune. Build and runtime use the same Node/libc image;
60
+ * runtime copies the built modules instead of reinstalling without a compiler.
61
+ * Native dependencies are built for the Docker target, never the host's modules.
12
62
  *
13
- * Stage 1 (build): installs all deps, compiles TypeScript.
14
- * Stage 2 (runtime): copies compiled output, installs production deps only.
63
+ * @param options - Layout, commands and system dependencies supplied by the caller.
64
+ * @returns A self-contained Dockerfile, paired dockerignore and identical build script.
65
+ * @example
66
+ * ```typescript
67
+ * import { generateApiDeploymentArtifacts } from '@molecule/api-staging-docker-compose'
15
68
  *
16
- * @returns Dockerfile content as a string.
69
+ * const files = generateApiDeploymentArtifacts({
70
+ * runtimeDirectory: 'api',
71
+ * runtimePaths: ['api', 'app/dist'],
72
+ * runtimeCommand: ['node', 'dist/server.js'],
73
+ * })
74
+ * // Inspect/merge files into the project; preserve existing user-owned artifacts.
75
+ * ```
17
76
  */
18
- export function generateApiDockerfile() {
19
- return `# Generated by @molecule/api-staging-docker-compose
20
- FROM node:20-alpine AS build
77
+ export function generateApiDeploymentArtifacts({ nodeImage = NODE_DEPLOYMENT_IMAGE, buildCommand = ['npm', 'run', 'build'], runtimeCommand = ['node', 'dist/server.js'], runtimePaths = ['dist'], runtimeDirectory = '.', buildPackages = [], runtimePackages = [], port = 4000, } = {}) {
78
+ if (typeof nodeImage !== 'string' || !/^[a-zA-Z0-9][a-zA-Z0-9._:/@-]*$/.test(nodeImage)) {
79
+ throw new Error('nodeImage must be one Debian/apt-based image reference');
80
+ }
81
+ if (!Number.isInteger(port) || port < 1 || port > 65535)
82
+ throw new Error('port must be between 1 and 65535');
83
+ if (!Array.isArray(buildPackages) || !Array.isArray(runtimePackages)) {
84
+ throw new Error('System packages must be arrays of Debian package names');
85
+ }
86
+ if (!Array.isArray(runtimePaths) || !runtimePaths.length)
87
+ throw new Error('runtimePaths must name built output');
88
+ const paths = [...new Set(runtimePaths.map(relativePath))];
89
+ if (paths.includes('.'))
90
+ throw new Error('Name runtime output paths explicitly, not the whole context');
91
+ const directory = relativePath(runtimeDirectory);
92
+ const build = command(buildCommand);
93
+ command(runtimeCommand);
94
+ const prerequisites = aptInstall([
95
+ ...new Set(['ca-certificates', 'python3', 'make', 'g++', ...buildPackages]),
96
+ ]);
97
+ const runtimePrerequisites = aptInstall([
98
+ ...new Set(['ca-certificates', ...runtimePackages]),
99
+ ]).replaceAll('\n', ' && ');
100
+ const copy = (source, destination) => `COPY --from=build --chown=node:node ${JSON.stringify([`/app/${source}`, destination])}`;
101
+ const buildScript = `#!/bin/sh
102
+ set -eu
103
+ # Native install scripts may fall back to node-gyp on any target architecture.
104
+ ${prerequisites}
105
+ # Source and workspace manifests must exist before prepare/postinstall run.
106
+ npm ci --include=dev --ignore-scripts=false --no-audit --no-fund
107
+ ${build}
108
+ # Preserve compiled native addons; never reinstall in a tool-less runtime.
109
+ npm prune --omit=dev --ignore-scripts --no-audit --no-fund
110
+ mkdir -p node_modules
111
+ `;
112
+ return {
113
+ Dockerfile: `# syntax=docker/dockerfile:1
114
+ # Generated by @molecule/api-staging-docker-compose
115
+ FROM ${nodeImage} AS build
21
116
  WORKDIR /app
22
- COPY package*.json ./
23
- RUN npm ci
24
117
  COPY . .
25
- RUN npm run build
118
+ RUN <<'MOLECULE_BUILD'
119
+ ${buildScript}MOLECULE_BUILD
26
120
 
27
- FROM node:20-alpine
121
+ FROM ${nodeImage} AS runtime
28
122
  WORKDIR /app
29
- COPY --from=build /app/package*.json ./
30
- RUN npm ci --omit=dev
31
- COPY --from=build /app/dist ./dist
32
- EXPOSE 4000
33
- CMD ["node", "dist/server.js"]
34
- `;
123
+ RUN ${runtimePrerequisites}
124
+ ENV NODE_ENV=production PORT=${port}
125
+ ${copy('package.json', './package.json')}
126
+ ${copy('node_modules', './node_modules')}
127
+ ${paths.map((path) => copy(path, `./${path}`)).join('\n')}
128
+ USER node
129
+ WORKDIR /app${directory === '.' ? '' : `/${directory}`}
130
+ EXPOSE ${port}
131
+ CMD ${JSON.stringify(runtimeCommand)}
132
+ `,
133
+ '.molecule/deploy/build.sh': buildScript,
134
+ '.dockerignore': `**/node_modules
135
+ **/dist
136
+ **/.git
137
+ **/.keys
138
+ **/.env*
139
+ !**/.env.example
140
+ **/coverage
141
+ **/test-results
142
+ *.log
143
+ `,
144
+ };
145
+ }
146
+ /**
147
+ * Generates a multi-stage Dockerfile for the API server.
148
+ *
149
+ * Uses generateApiDeploymentArtifacts, including its native install toolchain
150
+ * and matching build/runtime image. The paired ignore is available from that
151
+ * function; callers using another Dockerfile name should write it alongside
152
+ * that Dockerfile as <Dockerfile-name>.dockerignore.
153
+ *
154
+ * @param options - Explicit build/runtime facts; defaults preserve the package layout.
155
+ * @returns Dockerfile content as a string.
156
+ */
157
+ export function generateApiDockerfile(options = {}) {
158
+ return generateApiDeploymentArtifacts(options).Dockerfile;
35
159
  }
36
160
  /**
37
161
  * Generates a multi-stage Dockerfile for the frontend app.
@@ -58,7 +182,7 @@ export function generateAppDockerfile(envVars = {}) {
58
182
  .map((key) => `ENV ${key}=$${key}`)
59
183
  .join('\n');
60
184
  return `# Generated by @molecule/api-staging-docker-compose
61
- FROM node:20-alpine AS build
185
+ FROM ${NODE_DEPLOYMENT_IMAGE} AS build
62
186
  WORKDIR /app
63
187
  COPY package*.json ./
64
188
  RUN npm ci
@@ -1 +1 @@
1
- {"version":3,"file":"dockerfile-generator.js","sourceRoot":"","sources":["../src/dockerfile-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO;;;;;;;;;;;;;;;CAeR,CAAA;AACD,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,qBAAqB,CAAC,UAAkC,EAAE;IACxE,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;SAClC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,GAAG,EAAE,CAAC;SAC1B,IAAI,CAAC,IAAI,CAAC,CAAA;IACb,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;SAClC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,GAAG,KAAK,GAAG,EAAE,CAAC;SAClC,IAAI,CAAC,IAAI,CAAC,CAAA;IAEb,OAAO;;;;;;EAMP,QAAQ;EACR,QAAQ;;;;;;;CAOT,CAAA;AACD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO;;;;;;;;;;;;;;;;;CAiBR,CAAA;AACD,CAAC"}
1
+ {"version":3,"file":"dockerfile-generator.js","sourceRoot":"","sources":["../src/dockerfile-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,6EAA6E;AAC7E,MAAM,CAAC,MAAM,qBAAqB,GAAG,0BAA0B,CAAA;AAE/D;;;;GAIG;AACH,SAAS,KAAK,CAAC,KAAa;IAC1B,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAA;AAChD,CAAC;AAED;;;;GAIG;AACH,SAAS,OAAO,CAAC,IAAuB;IACtC,IACE,CAA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AAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,qBAAqB,CAAC,UAAkC,EAAE;IACxE,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;SAClC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,GAAG,EAAE,CAAC;SAC1B,IAAI,CAAC,IAAI,CAAC,CAAA;IACb,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;SAClC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,GAAG,KAAK,GAAG,EAAE,CAAC;SAClC,IAAI,CAAC,IAAI,CAAC,CAAA;IAEb,OAAO;OACF,qBAAqB;;;;;EAK1B,QAAQ;EACR,QAAQ;;;;;;;CAOT,CAAA;AACD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO;;;;;;;;;;;;;;;;;CAiBR,CAAA;AACD,CAAC"}
package/dist/index.d.ts CHANGED
@@ -13,7 +13,32 @@
13
13
  * setProvider(provider)
14
14
  * ```
15
15
  *
16
+ * @example
17
+ * ```typescript
18
+ * import { generateApiDeploymentArtifacts } from '@molecule/api-staging-docker-compose'
19
+ *
20
+ * const files = generateApiDeploymentArtifacts({
21
+ * runtimeDirectory: 'api',
22
+ * runtimePaths: ['api', 'app/dist'],
23
+ * runtimeCommand: ['node', 'dist/server.js'],
24
+ * })
25
+ * // Ordinary Dockerfile/dockerignore/build script; caller owns file writes and hosting.
26
+ * ```
27
+ *
16
28
  * @remarks
29
+ * - API artifacts use a patched Node 22 Debian base and build native modules
30
+ * with Python/make/C++. Install lifecycle scripts run with project source
31
+ * present; dev dependencies are pruned before built modules move into the
32
+ * matching, nonroot runtime. No second production install recompiles native
33
+ * modules without tools. Use the generated dockerignore to exclude host
34
+ * node_modules and local secrets. For a workspace root, explicitly carry its
35
+ * server workspace (including manifests/nested dependencies) and frontend
36
+ * output. Extra system libraries and alternative apt-based images are caller
37
+ * configuration; native compatibility must be verified on the target platform.
38
+ * - Artifact generation is pure: it starts no container, infers no database or
39
+ * route and overwrites no project file. The Compose provider uses these files
40
+ * for its existing separate API/App contexts; other deployment callers can
41
+ * use the same generator without adopting Compose's service topology.
17
42
  * - Requires Docker Compose v2.24+ and BuildKit: the generated compose file
18
43
  * uses long-syntax `env_file` (`required: false` — a project without `.env`
19
44
  * or `.env.staging` must still stage) and a named `additional_contexts`
@@ -52,5 +77,6 @@
52
77
  export * from './browser-guard.js';
53
78
  export * from './compose-generator.js';
54
79
  export * from './dockerfile-generator.js';
80
+ export * from './types.js';
55
81
  export * from './provider.js';
56
82
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAGH,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA;AAGzC,cAAc,eAAe,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2EG;AAGH,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA;AACzC,cAAc,YAAY,CAAA;AAG1B,cAAc,eAAe,CAAA"}
package/dist/index.js CHANGED
@@ -13,7 +13,32 @@
13
13
  * setProvider(provider)
14
14
  * ```
15
15
  *
16
+ * @example
17
+ * ```typescript
18
+ * import { generateApiDeploymentArtifacts } from '@molecule/api-staging-docker-compose'
19
+ *
20
+ * const files = generateApiDeploymentArtifacts({
21
+ * runtimeDirectory: 'api',
22
+ * runtimePaths: ['api', 'app/dist'],
23
+ * runtimeCommand: ['node', 'dist/server.js'],
24
+ * })
25
+ * // Ordinary Dockerfile/dockerignore/build script; caller owns file writes and hosting.
26
+ * ```
27
+ *
16
28
  * @remarks
29
+ * - API artifacts use a patched Node 22 Debian base and build native modules
30
+ * with Python/make/C++. Install lifecycle scripts run with project source
31
+ * present; dev dependencies are pruned before built modules move into the
32
+ * matching, nonroot runtime. No second production install recompiles native
33
+ * modules without tools. Use the generated dockerignore to exclude host
34
+ * node_modules and local secrets. For a workspace root, explicitly carry its
35
+ * server workspace (including manifests/nested dependencies) and frontend
36
+ * output. Extra system libraries and alternative apt-based images are caller
37
+ * configuration; native compatibility must be verified on the target platform.
38
+ * - Artifact generation is pure: it starts no container, infers no database or
39
+ * route and overwrites no project file. The Compose provider uses these files
40
+ * for its existing separate API/App contexts; other deployment callers can
41
+ * use the same generator without adopting Compose's service topology.
17
42
  * - Requires Docker Compose v2.24+ and BuildKit: the generated compose file
18
43
  * uses long-syntax `env_file` (`required: false` — a project without `.env`
19
44
  * or `.env.staging` must still stage) and a named `additional_contexts`
@@ -53,6 +78,7 @@
53
78
  export * from './browser-guard.js';
54
79
  export * from './compose-generator.js';
55
80
  export * from './dockerfile-generator.js';
81
+ export * from './types.js';
56
82
  // Provider exports
57
83
  export * from './provider.js';
58
84
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH,oBAAoB;AACpB,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA;AAEzC,mBAAmB;AACnB,cAAc,eAAe,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2EG;AAEH,oBAAoB;AACpB,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA;AACzC,cAAc,YAAY,CAAA;AAE1B,mBAAmB;AACnB,cAAc,eAAe,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,KAAK,EAIV,aAAa,EAGd,MAAM,uBAAuB,CAAA;AA0C9B;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAI3F;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAK7F;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAAY,GAAG,MAAM,CAOpF;AAED,0EAA0E;AAC1E,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAK9E;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,SAAS,CAAC,EAAE,sBAAsB,GAAG,MAAM,CAE1E;AA6ED;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,aA0QtB,CAAA"}
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,KAAK,EAIV,aAAa,EAGd,MAAM,uBAAuB,CAAA;AA0C9B;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAI3F;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAK7F;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAAY,GAAG,MAAM,CAOpF;AAED,0EAA0E;AAC1E,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAK9E;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,SAAS,CAAC,EAAE,sBAAsB,GAAG,MAAM,CAE1E;AA6ED;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,aAgRtB,CAAA"}
package/dist/provider.js CHANGED
@@ -12,7 +12,7 @@ import { access, mkdir, readFile, rm, writeFile } from 'node:fs/promises';
12
12
  import { join } from 'node:path';
13
13
  import { promisify } from 'node:util';
14
14
  import { generateComposeFile } from './compose-generator.js';
15
- import { generateApiDockerfile, generateAppDockerfile, generateNginxConf, } from './dockerfile-generator.js';
15
+ import { generateApiDeploymentArtifacts, generateAppDockerfile, generateNginxConf, } from './dockerfile-generator.js';
16
16
  const execFileAsync = promisify(execFile);
17
17
  const STAGING_DIR = '.molecule/staging';
18
18
  /**
@@ -232,8 +232,12 @@ export const provider = {
232
232
  const appPort = env.driverMeta?.appPort ?? fallbackPort(5174, env.slug);
233
233
  const dbPort = env.driverMeta?.dbPort ?? fallbackPort(5433, env.slug);
234
234
  // Generate Dockerfiles and nginx config in .molecule/staging/
235
- await writeFile(join(stagingDir, 'Dockerfile.api'), generateApiDockerfile());
235
+ const apiArtifacts = generateApiDeploymentArtifacts();
236
+ await writeFile(join(stagingDir, 'Dockerfile.api'), apiArtifacts.Dockerfile);
237
+ const ignore = apiArtifacts['.dockerignore'];
238
+ await writeFile(join(stagingDir, 'Dockerfile.api.dockerignore'), ignore);
236
239
  await writeFile(join(stagingDir, 'Dockerfile.app'), generateAppDockerfile({ VITE_API_URL: `http://localhost:${apiPort}/api` }));
240
+ await writeFile(join(stagingDir, 'Dockerfile.app.dockerignore'), ignore);
237
241
  await writeFile(join(stagingDir, 'nginx.conf'), generateNginxConf());
238
242
  // Generate compose file (references the generated Dockerfiles)
239
243
  const composeContent = generateComposeFile(env, {
@@ -298,7 +302,7 @@ export const provider = {
298
302
  // Staging dir already gone — nothing shared left to preserve
299
303
  }
300
304
  if (composeFilesLeft.length === 0) {
301
- filesToRemove.push(join(stagingDir, 'Dockerfile.api'), join(stagingDir, 'Dockerfile.app'), join(stagingDir, 'nginx.conf'));
305
+ filesToRemove.push(join(stagingDir, 'Dockerfile.api'), join(stagingDir, 'Dockerfile.api.dockerignore'), join(stagingDir, 'Dockerfile.app'), join(stagingDir, 'Dockerfile.app.dockerignore'), join(stagingDir, 'nginx.conf'));
302
306
  }
303
307
  for (const filePath of filesToRemove) {
304
308
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,E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AC,CAAA;YAExD,iEAAiE;YACjE,sEAAsE;YACtE,uEAAuE;YACvE,iDAAiD;YACjD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;YAC7E,MAAM,IAAI,GAAG,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAA;YAEvC,YAAY,CAAC,IAAI,CAAC;gBAChB,IAAI;gBACJ,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI;gBAChC,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,WAAW,IAAI,EAAE;gBACvB,SAAS,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE;gBAClC,MAAM,EAAE,gBAAgB;aACzB,CAAC,CAAA;QACJ,CAAC;QAED,OAAO,YAAY,CAAA;IACrB,CAAC;CACF,CAAA"}
@@ -0,0 +1,29 @@
1
+ /** Explicit project facts used to generate a native-compatible Node deployment. */
2
+ export interface ApiDeploymentArtifactOptions {
3
+ /** One Debian/apt-based image for build and runtime; an immutable digest is supported. */
4
+ nodeImage?: string;
5
+ /** Build command as argv, executed after npm ci with install scripts enabled. */
6
+ buildCommand?: readonly string[];
7
+ /** Server command as argv, executed without a shell. */
8
+ runtimeCommand?: readonly string[];
9
+ /** Output paths to carry. For workspaces, include the server workspace and frontend output. */
10
+ runtimePaths?: readonly string[];
11
+ /** Server working directory relative to the build context root. */
12
+ runtimeDirectory?: string;
13
+ /** Additional Debian build prerequisites, beyond Python/make/C++. */
14
+ buildPackages?: readonly string[];
15
+ /** Additional Debian runtime libraries/tools. */
16
+ runtimePackages?: readonly string[];
17
+ /** Exposed container port; does not configure a hosting provider. */
18
+ port?: number;
19
+ }
20
+ /** Ordinary project files; callers own their write/merge policy for existing files. */
21
+ export interface ApiDeploymentArtifacts {
22
+ /** Self-contained multi-stage Dockerfile; does not depend on the external build script. */
23
+ Dockerfile: string;
24
+ /** The identical POSIX install/build/prune body embedded in the Dockerfile. */
25
+ '.molecule/deploy/build.sh': string;
26
+ /** Build-context exclusions for host modules, old output and local secrets. */
27
+ '.dockerignore': string;
28
+ }
29
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,MAAM,WAAW,4BAA4B;IAC3C,0FAA0F;IAC1F,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iFAAiF;IACjF,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAChC,wDAAwD;IACxD,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAClC,+FAA+F;IAC/F,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAChC,mEAAmE;IACnE,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,qEAAqE;IACrE,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC,iDAAiD;IACjD,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACnC,qEAAqE;IACrE,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,uFAAuF;AACvF,MAAM,WAAW,sBAAsB;IACrC,2FAA2F;IAC3F,UAAU,EAAE,MAAM,CAAA;IAClB,+EAA+E;IAC/E,2BAA2B,EAAE,MAAM,CAAA;IACnC,+EAA+E;IAC/E,eAAe,EAAE,MAAM,CAAA;CACxB"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/api-staging-docker-compose",
3
- "version": "1.0.3",
3
+ "version": "1.1.0",
4
4
  "description": "Docker Compose staging driver for local ephemeral environments in molecule.dev",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -31,17 +31,17 @@
31
31
  "@molecule/api-staging": "^1.0.1"
32
32
  },
33
33
  "devDependencies": {
34
- "@molecule/api-staging": "1.0.1",
34
+ "@molecule/api-staging": "1.0.2",
35
35
  "@types/node": "26.1.2",
36
36
  "typescript": "6.0.3",
37
- "vitest": "4.1.11"
37
+ "vitest": "4.1.12"
38
38
  },
39
39
  "repository": {
40
40
  "type": "git",
41
41
  "url": "https://github.com/molecule-dev/molecule.git",
42
42
  "directory": "packages/api/staging/docker-compose"
43
43
  },
44
- "homepage": "https://github.com/molecule-dev/molecule/tree/main/packages/api/staging/docker-compose",
44
+ "homepage": "https://www.molecule.dev/packages/api-staging-docker-compose",
45
45
  "bugs": "https://github.com/molecule-dev/molecule/issues",
46
46
  "publishConfig": {
47
47
  "access": "public"