Skip to content

Commit 457e27d

Browse files
authored
Merge pull request #60 from restackio/posthog-to-functions
2 parents 1a576d9 + be2d0a8 commit 457e27d

30 files changed

+1169
-179
lines changed

posthog/.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ POSTHOG_API_KEY=
44
POSTHOG_PROJECT_ID=
55
POSTHOG_HOST=https://us.posthog.com
66
OPENAI_API_KEY=
7+
LINEAR_API_KEY=
78

89
# (Optional) Restack Cloud - You only need to set these if you are using Restack Cloud
910

posthog/Dockerfile

+41-42
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,43 @@
11
# ------- Image ----------
22

3-
FROM node:20-bullseye-slim AS installer
4-
5-
RUN apt-get update \
6-
&& apt-get install -y ca-certificates \
7-
&& rm -rf /var/lib/apt/lists/*
8-
9-
COPY ./package.json ./app/package.json
10-
COPY ./tsconfig.json ./app/tsconfig.json
11-
12-
13-
WORKDIR /app
14-
15-
RUN npm install
16-
17-
# ------- Builder ----------
18-
19-
FROM node:20-bullseye-slim AS builder
20-
WORKDIR /app
21-
COPY --from=installer /app .
22-
COPY ./src ./src
23-
24-
RUN npm run build
25-
26-
# ------- Runner ----------
27-
28-
FROM node:20-bullseye-slim AS runner
29-
30-
RUN apt-get update \
31-
&& apt-get install -y ca-certificates \
32-
&& rm -rf /var/lib/apt/lists/*
33-
34-
RUN addgroup --system --gid 1001 service
35-
RUN adduser --system --uid 1001 service
36-
USER service
37-
38-
WORKDIR /app
39-
40-
COPY --from=builder /app .
41-
42-
ENV NODE_OPTIONS=”--max-old-space-size=4096″
43-
44-
CMD ["node", "dist/services"]
3+
FROM node:20-bullseye-slim AS installer
4+
5+
RUN apt-get update \
6+
&& apt-get install -y ca-certificates \
7+
&& rm -rf /var/lib/apt/lists/*
8+
9+
COPY ./package.json ./app/package.json
10+
COPY ./tsconfig.json ./app/tsconfig.json
11+
12+
WORKDIR /app
13+
14+
RUN npm install
15+
16+
# ------- Builder ----------
17+
18+
FROM node:20-bullseye-slim AS builder
19+
WORKDIR /app
20+
COPY --from=installer /app .
21+
COPY ./src ./src
22+
23+
RUN npm run build
24+
25+
# ------- Runner ----------
26+
27+
FROM node:20-bullseye-slim AS runner
28+
29+
RUN apt-get update \
30+
&& apt-get install -y ca-certificates \
31+
&& rm -rf /var/lib/apt/lists/*
32+
33+
RUN addgroup --system --gid 1001 service
34+
RUN adduser --system --uid 1001 service
35+
USER service
36+
37+
WORKDIR /app
38+
39+
COPY --from=builder /app .
40+
41+
ENV NODE_OPTIONS="--max-old-space-size=4096"
42+
43+
CMD ["node", "dist/services"]

posthog/package.json

+21-16
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,34 @@
88
"dev": "ts-node-dev --respawn --transpile-only src/services.ts",
99
"build": "tsc --build",
1010
"clean": "rm -rf node_modules",
11+
"restack-engine": "docker run -d --pull always --name restack -p 5233:5233 -p 6233:6233 -p 7233:7233 ghcr.io/restackio/restack:main",
12+
"docker:build": "docker build -t posthog .",
13+
"docker:run": "docker run -d -p 4000:4000 posthog",
1114
"schedule": "ts-node ./scheduleWorkflow.ts",
12-
"restack-up": "node restack_up.mjs"
15+
"restack-up": "dotenv -e .env -- tsx restack_up.mjs"
1316
},
1417
"keywords": [],
1518
"author": "",
1619
"license": "ISC",
1720
"dependencies": {
18-
"@restackio/ai": "^0.0.85",
19-
"@restackio/integrations-linear": "^0.0.8",
20-
"@restackio/integrations-openai": "^0.0.34",
21-
"@temporalio/workflow": "1.11.1",
22-
"dotenv": "^16.4.5",
23-
"typescript": "^5.6.2",
24-
"uuid": "^10.0.0",
25-
"zod": "^3.23.8",
26-
"zod-to-json-schema": "^3.23.3"
21+
"@restackio/ai": "0.0.86",
22+
"@temporalio/workflow": "1.11.2",
23+
"@linear/sdk": "29.0.0",
24+
"dotenv": "16.4.5",
25+
"openai": "4.71.1",
26+
"typescript": "5.6.2",
27+
"uuid": "10.0.0",
28+
"zod": "3.23.8",
29+
"zod-to-json-schema": "3.23.3",
30+
"tsx": "4.19.2"
2731
},
2832
"devDependencies": {
29-
"@restackio/cloud": "^1.0.19",
30-
"@types/node": "^22.5.5",
31-
"@types/uuid": "^10.0.0",
32-
"nodemon": "^3.1.4",
33-
"ts-node": "^10.9.2",
34-
"ts-node-dev": "^2.0.0"
33+
"@restackio/cloud": "1.0.21",
34+
"@types/node": "22.5.5",
35+
"@types/uuid": "10.0.0",
36+
"dotenv-cli": "7.4.4",
37+
"nodemon": "3.1.4",
38+
"ts-node": "10.9.2",
39+
"ts-node-dev": "2.0.0"
3540
}
3641
}

0 commit comments

Comments
 (0)