Skip to content

Commit

Permalink
chore: added docker for eth shuttle
Browse files Browse the repository at this point in the history
  • Loading branch information
javiersuweijie committed Jul 4, 2024
1 parent a9e82e9 commit 11adfd4
Show file tree
Hide file tree
Showing 5 changed files with 6,588 additions and 15,538 deletions.
3 changes: 3 additions & 0 deletions eth/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
docker
.vscode
17 changes: 17 additions & 0 deletions eth/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM node:21 AS build-stage

WORKDIR /app

COPY package.json package.json
COPY package-lock.json package-lock.json

RUN npm ci

FROM node:21-alpine

WORKDIR /app

COPY --from=build-stage /app ./
COPY . /app

CMD ["npm", "start"]
5 changes: 5 additions & 0 deletions eth/create-db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
aws dynamodb create-table \
--table-name ShuttleTx \
--attribute-definitions AttributeName=ShuttleID,AttributeType=S AttributeName=FromTxHash,AttributeType=S \
--key-schema AttributeName=ShuttleID,KeyType=HASH AttributeName=FromTxHash,KeyType=RANGE \
--provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5
26 changes: 26 additions & 0 deletions eth/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '3.8'
services:
dynamodb-local:
command: "-jar DynamoDBLocal.jar -sharedDb -dbPath ./data"
image: "amazon/dynamodb-local:latest"
container_name: dynamodb-local
ports:
- "8000:8000"
volumes:
- "./docker/dynamodb:/home/dynamodblocal/data"
working_dir: /home/dynamodblocal
app-node:
build: .
depends_on:
- dynamodb-local
container_name: shuttle-eth
environment:
DYNAMO_ACCESS_KEY_ID: 'DUMMYIDEXAMPLE'
DYNAMO_SECRET_ACCESS_KEY: 'DUMMYEXAMPLEKEY'
DYNAMO_ENDPOINT: 'http://dynamodb-local:8000'
REDIS_URL: 'redis://redis:6379'
redis:
image: "redis"
container_name: redis
ports:
- 6379:6379
Loading

0 comments on commit 11adfd4

Please sign in to comment.