-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix:
rpc-proxy
Dockerfile using dependencies from the monorepo (#1378)
* fix: first commit * fix: ensure we run with local dependencies * fix: ensure we run with local dependencies * fix: ensure we run with local dependencies * fix: ensure we run with local dependencies * fix: ensure we run with local dependencies * fix: ensure we run with local dependencies * fix: added dockerignore file * fix: added dockerignore file * fix: added dockerignore file * fix: added dockerignore file * fix: test refactored * fix: test refactored * fix: test refactored * fix: using . since we are in the app folder * fix: added console log to test * fix: added console log to test
- Loading branch information
1 parent
8ecb124
commit d601cdc
Showing
29 changed files
with
129 additions
and
95 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
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
packages/*/node_modules | ||
packages/*/dist | ||
packages/*/.turbo | ||
packages/*/coverageUnit |
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,51 @@ | ||
# Stage 1: Build the app | ||
FROM node:20.17-alpine3.20 AS builder | ||
|
||
# Set the working directory in the builder stage | ||
WORKDIR /app | ||
|
||
# Copy the dependencies file to the working directory | ||
COPY ./packages/rpc-proxy ./packages/rpc-proxy | ||
COPY ./packages/network ./packages/network | ||
COPY ./packages/core ./packages/core | ||
COPY ./packages/logging ./packages/logging | ||
COPY ./packages/errors ./packages/errors | ||
COPY ./package.json ./package.json | ||
COPY ./turbo.json ./turbo.json | ||
COPY ./yarn.lock ./yarn.lock | ||
COPY ./tsconfig.json ./tsconfig.json | ||
|
||
# Install all the dependencies | ||
RUN yarn install | ||
|
||
# Build the app (assumes output is in /app/dist or similar) | ||
RUN yarn build | ||
|
||
# Stage 2: Serve the app using node | ||
FROM node:20.17.0-alpine3.20 AS runner | ||
|
||
# Copy only the built files and essential runtime files from the builder stage | ||
## rpc-proxy | ||
COPY --from=builder /app/packages/rpc-proxy/dist /app/packages/rpc-proxy/dist | ||
COPY --from=builder /app/packages/rpc-proxy/package.json /app/packages/rpc-proxy/package.json | ||
## SDK dependencies | ||
COPY --from=builder /app/packages/network/dist /app/packages/network/dist | ||
COPY --from=builder /app/packages/network/package.json /app/packages/network/package.json | ||
COPY --from=builder /app/packages/core/dist /app/packages/core/dist | ||
COPY --from=builder /app/packages/core/package.json /app/packages/core/package.json | ||
COPY --from=builder /app/packages/logging/dist /app/packages/logging/dist | ||
COPY --from=builder /app/packages/logging/package.json /app/packages/logging/package.json | ||
COPY --from=builder /app/packages/errors/dist /app/packages/errors/dist | ||
COPY --from=builder /app/packages/errors/package.json /app/packages/errors/package.json | ||
## node_modules | ||
COPY --from=builder /app/node_modules /app/node_modules | ||
|
||
# Create a new user to run the app so we do not use root | ||
RUN adduser -D rpc-proxy-user | ||
USER rpc-proxy-user | ||
|
||
# Tell we are running with Docker | ||
ENV RUNNING_WITH_DOCKER=true | ||
|
||
# Set the default command to use node to run the app | ||
CMD ["node", "/app/packages/rpc-proxy/dist/index.js"] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
|
@@ -20,8 +20,8 @@ | |
], | ||
"packageManager": "[email protected]", | ||
"scripts": { | ||
"start-thor-solo": "echo 'Starting thor solo node ...' && docker compose up -d --wait && echo '\nThor solo node started ...'", | ||
"stop-thor-solo": "echo 'Stopping thor solo node ...' && docker compose down && echo 'Thor solo node stopped ...'", | ||
"start-thor-solo": "echo 'Starting thor solo node ...' && docker compose -f docker-compose.thor.yml up -d --wait && echo '\nThor solo node started ...'", | ||
"stop-thor-solo": "echo 'Stopping thor solo node ...' && docker compose -f docker-compose.thor.yml down && echo 'Thor solo node stopped ...'", | ||
"postinstall": "husky", | ||
"build": "turbo build", | ||
"check:circular-dependencies": "turbo check:circular-dependencies", | ||
|
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
d601cdc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test Coverage
Summary