Skip to content

Commit 99518c2

Browse files
authored
Merge pull request #50 from restackio/child-workflows
2 parents 537b6c2 + 2bd315d commit 99518c2

File tree

16 files changed

+3198
-0
lines changed

16 files changed

+3198
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Deploy on Restack Cloud
2+
3+
RESTACK_ENGINE_ID=
4+
RESTACK_ENGINE_ADDRESS=
5+
RESTACK_ENGINE_API_KEY=
6+
7+
RESTACK_CLOUD_TOKEN=
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Build stage
2+
FROM node:20-bullseye AS builder
3+
4+
WORKDIR /app
5+
6+
# Install pnpm
7+
RUN npm install -g pnpm
8+
9+
# Copy package files and env file if it exists
10+
COPY package*.json .env* ./
11+
12+
# Copy package files
13+
COPY package*.json ./
14+
15+
# Install dependencies including TypeScript
16+
RUN pnpm install
17+
RUN pnpm add -D typescript
18+
19+
# Copy source code
20+
COPY . .
21+
22+
# Build TypeScript code
23+
RUN pnpm run build
24+
25+
# Production stage
26+
FROM node:20-bullseye
27+
28+
WORKDIR /app
29+
30+
# Install pnpm
31+
RUN npm install -g pnpm
32+
33+
# Copy package files and built code
34+
COPY --from=builder /app/package*.json ./
35+
COPY --from=builder /app/dist ./dist
36+
37+
# Install production dependencies only
38+
RUN pnpm install --prod
39+
40+
# Define environment variables
41+
ARG RESTACK_ENGINE_ID
42+
ENV RESTACK_ENGINE_ID=${RESTACK_ENGINE_ID}
43+
44+
ARG RESTACK_ENGINE_ADDRESS
45+
ENV RESTACK_ENGINE_ADDRESS=${RESTACK_ENGINE_ADDRESS}
46+
47+
ARG RESTACK_ENGINE_API_KEY
48+
ENV RESTACK_ENGINE_API_KEY=${RESTACK_ENGINE_API_KEY}
49+
50+
EXPOSE 3000
51+
52+
CMD ["node", "dist/services.js"]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "sdk-example-child-workflows",
3+
"version": "0.0.1",
4+
"description": "Restack Child Workflows example",
5+
"scripts": {
6+
"dev": "tsx watch --include src src/services.ts",
7+
"build": "tsc --build",
8+
"schedule-workflow": "tsx scheduleWorkflow.ts",
9+
"restack-up": "tsx restackUp.ts",
10+
"restack-web-ui": "docker run -d --pull always --name restack -p 5233:5233 -p 6233:6233 -p 7233:7233 ghcr.io/restackio/restack:main",
11+
"restack:up": "dotenv -e .env node restack_up.mjs",
12+
"docker:build": "docker build -t restack-child-workflows .",
13+
"docker:run": "docker run -d --name restack-child-workflows -p 3000:3000 restack-child-workflows"
14+
},
15+
"dependencies": {
16+
"@restackio/ai": "0.0.86",
17+
"@temporalio/workflow": "1.11.2",
18+
"dotenv": "16.4.5",
19+
"zod": "3.23.8",
20+
"zod-to-json-schema": "3.23.3"
21+
},
22+
"devDependencies": {
23+
"@restackio/cloud": "^1.0.19",
24+
"dotenv-cli": "^7.4.2",
25+
"@types/node": "20.16.9",
26+
"prettier": "3.3.3",
27+
"tsx": "4.19.2",
28+
"typescript": "5.6.3"
29+
}
30+
}

0 commit comments

Comments
 (0)