-
Notifications
You must be signed in to change notification settings - Fork 845
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
91 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
FROM node:alpine AS build | ||
WORKDIR /app | ||
COPY package.json tsconfig.json vite.config.ts ./ | ||
RUN npm install | ||
COPY packages src | ||
RUN npm run build:local | ||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ | ||
RUN npm install && npm install -g pnpm | ||
COPY . . | ||
RUN pnpm install && pnpm -r run build | ||
|
||
|
||
FROM node:alpine AS production | ||
WORKDIR /app | ||
COPY package.json ./ | ||
RUN npm install --omit=dev | ||
COPY --from=build /app/dist ./dist | ||
COPY packages/apps/local/package.docker.json package.json | ||
RUN npm install | ||
COPY --from=build /app/packages/apps/local/dist/index.js index.js | ||
EXPOSE 8787 | ||
CMD ["npm", "run", "start:dist"] | ||
CMD ["npm", "run", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
export PATH := $(shell pwd)/node_modules/.bin:$(PATH) | ||
SHELL := /bin/bash | ||
|
||
.PHONY: init | ||
init: | ||
npm install -g pnpm | ||
pnpm install | ||
|
||
.PHONY: version | ||
version: | ||
pnpm run version | ||
|
||
.PHONY: core | ||
core: version | ||
pnpm run --filter @chatgpt-telegram-workers/core build | ||
|
||
.PHONY: next | ||
next: core | ||
pnpm run --filter @chatgpt-telegram-workers/next build | ||
|
||
.PHONY: local | ||
local: next | ||
pnpm run --filter @chatgpt-telegram-workers/local build | ||
|
||
.PHONY: vercel | ||
vercel: core | ||
pnpm run --filter @chatgpt-telegram-workers/vercel build | ||
|
||
.PHONY: workers | ||
workers: core | ||
pnpm run --filter @chatgpt-telegram-workers/workers build | ||
cp -r packages/apps/workers/dist/* dist/ | ||
|
||
.PHONY: workers-next | ||
workers-next: next | ||
pnpm run --filter @chatgpt-telegram-workers/workers build | ||
|
||
.PHONY: all | ||
all: | ||
pnpm -r run build | ||
|
||
.PHONY: docker | ||
docker: | ||
docker build -t chatgpt-telegram-workers:latest . | ||
|
||
.PHONY: docker-all | ||
docker-all: | ||
docker build --platform linux/amd64,linux/arm64 -t tbxark/chatgpt-telegram-workers:latest --push . | ||
|
||
.PHONY: deploy-workers | ||
deploy-workers: workers | ||
wrangler deploy --config=wrangler.toml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "@chatgpt-telegram-workers/local", | ||
"type": "module", | ||
"version": "1.10.2", | ||
"scripts": { | ||
"start": "node index.js" | ||
}, | ||
"dependencies": { | ||
"cloudflare-worker-adapter": "^1.3.3" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"buildCommand": "pnpm run build", | ||
"builds": [ | ||
{ "src": "packages/apps/vercel/dist//**", "use": "@vercel/node" } | ||
], | ||
"routes": [ | ||
{ "src": "/(.*)", "dest": "/packages/apps/vercel/dist/**" } | ||
] | ||
} |