Skip to content

Commit f1ead2e

Browse files
committed
fix docker image build
1 parent 30377d7 commit f1ead2e

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

apps/sim/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616
"load:workflow:baseline": "BASE_URL=${BASE_URL:-http://localhost:3000} WARMUP_DURATION=${WARMUP_DURATION:-10} WARMUP_RATE=${WARMUP_RATE:-2} PEAK_RATE=${PEAK_RATE:-8} HOLD_DURATION=${HOLD_DURATION:-20} bunx artillery run scripts/load/workflow-concurrency.yml",
1717
"load:workflow:waves": "BASE_URL=${BASE_URL:-http://localhost:3000} WAVE_ONE_DURATION=${WAVE_ONE_DURATION:-10} WAVE_ONE_RATE=${WAVE_ONE_RATE:-6} QUIET_DURATION=${QUIET_DURATION:-5} WAVE_TWO_DURATION=${WAVE_TWO_DURATION:-15} WAVE_TWO_RATE=${WAVE_TWO_RATE:-8} WAVE_THREE_DURATION=${WAVE_THREE_DURATION:-20} WAVE_THREE_RATE=${WAVE_THREE_RATE:-10} bunx artillery run scripts/load/workflow-waves.yml",
1818
"load:workflow:isolation": "BASE_URL=${BASE_URL:-http://localhost:3000} ISOLATION_DURATION=${ISOLATION_DURATION:-30} TOTAL_RATE=${TOTAL_RATE:-9} WORKSPACE_A_WEIGHT=${WORKSPACE_A_WEIGHT:-8} WORKSPACE_B_WEIGHT=${WORKSPACE_B_WEIGHT:-1} bunx artillery run scripts/load/workflow-isolation.yml",
19-
"build": "bun run build:pptx-worker && bun run build:worker && next build",
19+
"build": "bun run build:pptx-worker && next build",
2020
"build:pptx-worker": "bun build ./lib/execution/pptx-worker.cjs --target=node --format=cjs --outfile ./dist/pptx-worker.cjs",
21-
"build:worker": "bun build ./worker/index.ts --target=node --format=esm --splitting --outdir ./dist/worker --external isolated-vm",
2221
"start": "next start",
2322
"worker": "NODE_ENV=production bun run worker/index.ts",
2423
"prepare": "cd ../.. && bun husky",

docker-compose.local.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ services:
7171
build:
7272
context: .
7373
dockerfile: docker/app.Dockerfile
74-
command: ['bun', 'apps/sim/dist/worker/index.js']
74+
command: ['bun', 'apps/sim/worker/index.ts']
7575
restart: unless-stopped
7676
deploy:
7777
resources:

docker-compose.prod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ services:
4242

4343
sim-worker:
4444
image: ghcr.io/simstudioai/simstudio:latest
45-
command: ['bun', 'apps/sim/dist/worker/index.js']
45+
command: ['bun', 'apps/sim/worker/index.ts']
4646
restart: unless-stopped
4747
deploy:
4848
resources:

docker/app.Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ COPY --from=builder --chown=nextjs:nodejs /app/apps/sim/public ./apps/sim/public
105105
COPY --from=builder --chown=nextjs:nodejs /app/apps/sim/.next/standalone ./
106106
COPY --from=builder --chown=nextjs:nodejs /app/apps/sim/.next/static ./apps/sim/.next/static
107107

108+
# Copy the full dependency tree and app source so the BullMQ worker can run from source.
109+
# The standalone server continues to use server.js; the worker uses bun on worker/index.ts.
110+
COPY --from=deps --chown=nextjs:nodejs /app/node_modules ./node_modules
111+
COPY --from=builder --chown=nextjs:nodejs /app/apps/sim ./apps/sim
112+
COPY --from=builder --chown=nextjs:nodejs /app/packages ./packages
113+
108114
# Copy isolated-vm native module (compiled for Node.js in deps stage)
109115
COPY --from=deps --chown=nextjs:nodejs /app/node_modules/isolated-vm ./node_modules/isolated-vm
110116

@@ -114,9 +120,6 @@ COPY --from=builder --chown=nextjs:nodejs /app/apps/sim/lib/execution/isolated-v
114120
# Copy the bundled PPTX worker artifact
115121
COPY --from=builder --chown=nextjs:nodejs /app/apps/sim/dist/pptx-worker.cjs ./apps/sim/dist/pptx-worker.cjs
116122

117-
# Copy the bundled BullMQ worker (self-contained ESM bundle, only isolated-vm is external)
118-
COPY --from=builder --chown=nextjs:nodejs /app/apps/sim/dist/worker ./apps/sim/dist/worker
119-
120123
# Guardrails setup with pip caching
121124
COPY --from=builder --chown=nextjs:nodejs /app/apps/sim/lib/guardrails/requirements.txt ./apps/sim/lib/guardrails/requirements.txt
122125
COPY --from=builder --chown=nextjs:nodejs /app/apps/sim/lib/guardrails/validate_pii.py ./apps/sim/lib/guardrails/validate_pii.py

helm/sim/templates/deployment-worker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ spec:
3737
- name: worker
3838
image: {{ include "sim.image" (dict "context" . "image" .Values.worker.image) }}
3939
imagePullPolicy: {{ .Values.worker.image.pullPolicy }}
40-
command: ["bun", "apps/sim/dist/worker/index.js"]
40+
command: ["bun", "apps/sim/worker/index.ts"]
4141
ports:
4242
- name: health
4343
containerPort: {{ .Values.worker.healthPort }}

0 commit comments

Comments
 (0)