-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bun wasn't handling the disconnect event in the same way, which resulted in downtime. Also set automatic restarts in docker compose. Renamed event-subscriber to more accurate "api". Added graceful shutdown to event-publisher for faster restarts. Signed-off-by: Brian Evans <[email protected]>
- Loading branch information
1 parent
37618df
commit 1d65d32
Showing
6 changed files
with
65 additions
and
17 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 |
---|---|---|
|
@@ -9,4 +9,4 @@ COPY . . | |
|
||
EXPOSE 3000 | ||
|
||
CMD ["bun", "start"] | ||
CMD ["bun", "--smol", "run", "src/redis/streamFromRedis.ts"] |
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,22 @@ | ||
FROM oven/bun as builder | ||
|
||
WORKDIR /companies-stream/server | ||
|
||
COPY package.json bun.lockb ./ | ||
RUN bun install --frozen-lockfile | ||
|
||
COPY . . | ||
|
||
RUN bun build src/redis/streamToRedis.ts --outdir dist --target=node | ||
# hack to fix Bun bundler https://github.com/oven-sh/bun/issues/6168 | ||
RUN echo 'import { createRequire as createImportMetaRequire } from "module"; import.meta.require ||= (id) => createImportMetaRequire(import.meta.url)(id);' | cat - dist/streamToRedis.js > temp && mv temp dist/streamToRedis.js | ||
|
||
|
||
FROM node:lts | ||
|
||
WORKDIR /companies-stream/server | ||
|
||
COPY --from=builder /companies-stream/server/dist /companies-stream/server/dist | ||
COPY --from=builder /companies-stream/server/package.json /companies-stream/server/package.json | ||
|
||
CMD ["node", "dist/streamToRedis.js"] |
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