Skip to content

Commit

Permalink
feat(rpc): adds Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
allemanfredi committed Oct 1, 2024
1 parent ca95bfd commit 16932b9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 10 deletions.
26 changes: 17 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ version: "3.8"

services:
mongodb:
image: mongo:latest
container_name: mongodb
ports:
- "27017:27017"
networks:
- mongo-network
volumes:
- mongo-data:/data/db
image: mongo:latest
container_name: mongodb
ports:
- "27017:27017"
networks:
- mongo-network
volumes:
- mongo-data:/data/db

hashi_relayer:
build:
Expand Down Expand Up @@ -37,10 +37,18 @@ services:
dockerfile: packages/reporter/Dockerfile
container_name: hashi_reporter

hashi_rpc:
build:
context: .
dockerfile: packages/rpc/Dockerfile
ports:
- "3000:3000"
container_name: hashi_rpc

networks:
mongo-network:
driver: bridge

volumes:
mongo-data:
driver: local
driver: local
2 changes: 1 addition & 1 deletion packages/rpc/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
PORT=
PORT=3000
JSON_RPC_URL_1=
18 changes: 18 additions & 0 deletions packages/rpc/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node:22-alpine

WORKDIR /usr/src/app

# Copy root package.json and yarn.lock for dependency resolution
COPY ../../package.json ../../yarn.lock ./

COPY ./packages/common ./packages/common
COPY ./packages/rpc ./packages/rpc

RUN yarn install

WORKDIR /usr/src/app/packages/rpc
RUN yarn compile

EXPOSE 3000

CMD ["yarn", "start:prod"]

0 comments on commit 16932b9

Please sign in to comment.