Skip to content

Commit

Permalink
Merge branch 'feat/erpc-builder' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
KONFeature committed Dec 17, 2024
2 parents 162d15e + 25233af commit 9294788
Show file tree
Hide file tree
Showing 14 changed files with 458 additions and 565 deletions.
Binary file modified bun.lockb
Binary file not shown.
6 changes: 1 addition & 5 deletions infra/erpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ import { cluster, vpc } from "./common.ts";
import { ServiceTargets } from "./components/ServiceTargets.ts";
import { SstService } from "./utils.ts";

if ($app.stage !== "production") {
throw new Error("eRPC is reserved for production usage");
}

// Get the image we will deploy
const image = await aws.ecr.getImage({
repositoryName: "erpc",
Expand All @@ -17,7 +13,7 @@ const image = await aws.ecr.getImage({
// Create the service targets
const erpcServiceTargets = new ServiceTargets("ErpcServiceDomain", {
vpcId: vpc.id,
domain: "rpc.frak.id",
domain: $app.stage === "production" ? "rpc.frak.id" : "rpc-dev.frak.id",
ports: [
{ listen: "80/http", forward: "8080/http" },
{ listen: "443/https", forward: "8080/http" },
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@
"engines": {
"node": ">=18.14"
},
"packageManager": "[email protected]",
"workspaces": ["packages/*"]
}
19 changes: 13 additions & 6 deletions packages/erpc/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# Base image is erpc
FROM ghcr.io/erpc/erpc:0.0.24
# Config bundler step
FROM oven/bun:latest AS bundler
RUN mkdir -p /temp/dev

# Copy the config
COPY erpc.yaml /root/erpc.yaml
# Bundle everything in a single erpc.js file
COPY . /temp/dev
RUN cd /temp/dev && bun install --production
RUN cd /temp/dev && bun build --outfile ./erpc.js --minify --target node --external "@erpc-cloud/*" src/index.ts

EXPOSE 8080/tcp
EXPOSE 4001/tcp
# Final image
FROM erpc-dev:latest AS final
#FROM ghcr.io/erpc/erpc:latest AS FINAL

# Copy the bundled config
COPY --from=bundler ./temp/dev/erpc.js /root/erpc.js

# Run the server
CMD ["./erpc-server"]
310 changes: 0 additions & 310 deletions packages/erpc/erpc-config.ts

This file was deleted.

Loading

0 comments on commit 9294788

Please sign in to comment.