Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions posthog/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ POSTHOG_API_KEY=
POSTHOG_PROJECT_ID=
POSTHOG_HOST=https://us.posthog.com
OPENAI_API_KEY=
LINEAR_API_KEY=

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

Expand Down
83 changes: 41 additions & 42 deletions posthog/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,44 +1,43 @@
# ------- Image ----------

FROM node:20-bullseye-slim AS installer

RUN apt-get update \
&& apt-get install -y ca-certificates \
&& rm -rf /var/lib/apt/lists/*

COPY ./package.json ./app/package.json
COPY ./tsconfig.json ./app/tsconfig.json


WORKDIR /app

RUN npm install

# ------- Builder ----------

FROM node:20-bullseye-slim AS builder
WORKDIR /app
COPY --from=installer /app .
COPY ./src ./src

RUN npm run build

# ------- Runner ----------

FROM node:20-bullseye-slim AS runner

RUN apt-get update \
&& apt-get install -y ca-certificates \
&& rm -rf /var/lib/apt/lists/*

RUN addgroup --system --gid 1001 service
RUN adduser --system --uid 1001 service
USER service

WORKDIR /app

COPY --from=builder /app .

ENV NODE_OPTIONS=”--max-old-space-size=4096″

CMD ["node", "dist/services"]
FROM node:20-bullseye-slim AS installer

RUN apt-get update \
&& apt-get install -y ca-certificates \
&& rm -rf /var/lib/apt/lists/*

COPY ./package.json ./app/package.json
COPY ./tsconfig.json ./app/tsconfig.json

WORKDIR /app

RUN npm install

# ------- Builder ----------

FROM node:20-bullseye-slim AS builder
WORKDIR /app
COPY --from=installer /app .
COPY ./src ./src

RUN npm run build

# ------- Runner ----------

FROM node:20-bullseye-slim AS runner

RUN apt-get update \
&& apt-get install -y ca-certificates \
&& rm -rf /var/lib/apt/lists/*

RUN addgroup --system --gid 1001 service
RUN adduser --system --uid 1001 service
USER service

WORKDIR /app

COPY --from=builder /app .

ENV NODE_OPTIONS="--max-old-space-size=4096"

CMD ["node", "dist/services"]
37 changes: 21 additions & 16 deletions posthog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,34 @@
"dev": "ts-node-dev --respawn --transpile-only src/services.ts",
"build": "tsc --build",
"clean": "rm -rf node_modules",
"restack-engine": "docker run -d --pull always --name restack -p 5233:5233 -p 6233:6233 -p 7233:7233 ghcr.io/restackio/restack:main",
"docker:build": "docker build -t posthog .",
"docker:run": "docker run -d -p 4000:4000 posthog",
"schedule": "ts-node ./scheduleWorkflow.ts",
"restack-up": "node restack_up.mjs"
"restack-up": "dotenv -e .env -- tsx restack_up.mjs"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@restackio/ai": "^0.0.85",
"@restackio/integrations-linear": "^0.0.8",
"@restackio/integrations-openai": "^0.0.34",
"@temporalio/workflow": "1.11.1",
"dotenv": "^16.4.5",
"typescript": "^5.6.2",
"uuid": "^10.0.0",
"zod": "^3.23.8",
"zod-to-json-schema": "^3.23.3"
"@restackio/ai": "0.0.86",
"@temporalio/workflow": "1.11.2",
"@linear/sdk": "29.0.0",
"dotenv": "16.4.5",
"openai": "4.71.1",
"typescript": "5.6.2",
"uuid": "10.0.0",
"zod": "3.23.8",
"zod-to-json-schema": "3.23.3",
"tsx": "4.19.2"
},
"devDependencies": {
"@restackio/cloud": "^1.0.19",
"@types/node": "^22.5.5",
"@types/uuid": "^10.0.0",
"nodemon": "^3.1.4",
"ts-node": "^10.9.2",
"ts-node-dev": "^2.0.0"
"@restackio/cloud": "1.0.21",
"@types/node": "22.5.5",
"@types/uuid": "10.0.0",
"dotenv-cli": "7.4.4",
"nodemon": "3.1.4",
"ts-node": "10.9.2",
"ts-node-dev": "2.0.0"
}
}
Loading