Spaces:
Running
Running
Initial upload from Google Colab
Browse files- Dockerfile +5 -6
- entrypoint.sh +7 -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
|
| 19 |
|
| 20 |
-
HEALTHCHECK --interval=30s --timeout=
|
| 21 |
-
CMD wget -
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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: "
|
| 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: {
|