Skip to content

Commit 3073ed3

Browse files
committed
refactor, clean up
1 parent 0dc7bbc commit 3073ed3

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

apps/uptime/src/actions.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ export async function checkUptime(
347347
),
348348
]);
349349

350+
// return the full data for debugging, but later it'll be fire & forget, we won't need to.
350351
return {
351352
success: true,
352353
data: {
@@ -374,6 +375,7 @@ export async function checkUptime(
374375
},
375376
};
376377
} catch (error) {
378+
// for now we'll just error, but ideally i wanna add axiom OTEL and error logging here
377379
console.error(
378380
"Uptime check failed:",
379381
JSON.stringify({ siteId, url, error })

uptime.Dockerfile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
FROM oven/bun:1.3.0-debian AS build
2+
3+
WORKDIR /app
4+
5+
RUN apt-get update && apt-get install -y \
6+
python3 \
7+
make \
8+
g++ \
9+
&& rm -rf /var/lib/apt/lists/*
10+
11+
COPY package.json package.json
12+
COPY apps/uptime/package.json ./apps/uptime/package.json
13+
COPY packages/*/package.json ./packages/
14+
15+
COPY packages/ ./packages/
16+
17+
RUN bun install
18+
19+
COPY apps/uptime/src ./apps/uptime/src
20+
21+
ENV NODE_ENV=production
22+
23+
RUN bun build \
24+
--compile \
25+
--minify \
26+
--target bun \
27+
--outfile server \
28+
--sourcemap \
29+
--bytecode \
30+
./apps/uptime/src/index.ts
31+
32+
FROM gcr.io/distroless/base
33+
34+
WORKDIR /app
35+
36+
COPY --from=build /app/server server
37+
38+
ENV NODE_ENV=production
39+
40+
CMD ["./server"]
41+
42+
EXPOSE 4000

0 commit comments

Comments
 (0)