imseldrith commited on
Commit
d2b31db
·
verified ·
1 Parent(s): ec61b9c

Initial upload from Google Colab

Browse files
Files changed (3) hide show
  1. Dockerfile +5 -6
  2. entrypoint.sh +7 -3
  3. src/start.ts +1 -1
Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
  FROM oven/bun:1.2.19-alpine AS builder
2
  WORKDIR /app
3
 
4
- COPY package.json bun.lock ./
5
  RUN bun install --frozen-lockfile
6
 
7
  COPY . .
@@ -10,17 +10,16 @@ RUN bun run build
10
  FROM oven/bun:1.2.19-alpine AS runner
11
  WORKDIR /app
12
 
13
- COPY package.json bun.lock ./
14
  RUN bun install --frozen-lockfile --production --ignore-scripts --no-cache
15
 
16
  COPY --from=builder /app/dist ./dist
17
 
18
- EXPOSE 7860
19
 
20
- HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=5 \
21
- CMD wget -qO- http://127.0.0.1:7860/ >/dev/null || exit 1
22
 
23
  COPY entrypoint.sh /entrypoint.sh
24
  RUN chmod +x /entrypoint.sh
25
-
26
  ENTRYPOINT ["/entrypoint.sh"]
 
1
  FROM oven/bun:1.2.19-alpine AS builder
2
  WORKDIR /app
3
 
4
+ COPY ./package.json ./bun.lock ./
5
  RUN bun install --frozen-lockfile
6
 
7
  COPY . .
 
10
  FROM oven/bun:1.2.19-alpine AS runner
11
  WORKDIR /app
12
 
13
+ COPY ./package.json ./bun.lock ./
14
  RUN bun install --frozen-lockfile --production --ignore-scripts --no-cache
15
 
16
  COPY --from=builder /app/dist ./dist
17
 
18
+ EXPOSE 4141
19
 
20
+ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
21
+ CMD wget --spider -q http://localhost:4141/ || exit 1
22
 
23
  COPY entrypoint.sh /entrypoint.sh
24
  RUN chmod +x /entrypoint.sh
 
25
  ENTRYPOINT ["/entrypoint.sh"]
entrypoint.sh CHANGED
@@ -1,5 +1,9 @@
1
  #!/bin/sh
2
- set -e
 
 
 
 
 
 
3
 
4
- echo "Starting copilot-api..."
5
- exec bun run dist/main.js start -g "$GH_TOKEN"
 
1
  #!/bin/sh
2
+ if [ "$1" = "--auth" ]; then
3
+ # Run auth command
4
+ exec bun run dist/main.js auth
5
+ else
6
+ # Default command
7
+ exec bun run dist/main.js start -g "$GH_TOKEN" "$@"
8
+ fi
9
 
 
 
src/start.ts CHANGED
@@ -129,7 +129,7 @@ export const start = defineCommand({
129
  port: {
130
  alias: "p",
131
  type: "string",
132
- default: "7860",
133
  description: "Port to listen on",
134
  },
135
  verbose: {
 
129
  port: {
130
  alias: "p",
131
  type: "string",
132
+ default: "4141",
133
  description: "Port to listen on",
134
  },
135
  verbose: {