Skip to content

Commit d9a761d

Browse files
authored
Merge pull request #47 from drips-network/jason/docker-setup
docker setup
2 parents 5eeb387 + 6c386e5 commit d9a761d

29 files changed

+85
-298
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ README.md
44
docker/
55
dist/
66
node_modules/
7+
.husky/

.env.template

-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,3 @@ MAX_QUERY_DEPTH=number # Optional. defaults to 4.
3232
TIMEOUT_IN_SECONDS=number # Optional. defaults to 20.
3333

3434
IPFS_GATEWAY_URL=string # Optional. The IPFS gateway URL to use for fetching IPFS data. Defaults to 'https://drips.mypinata.cloud'.
35-

.github/workflows/e2e-tests.yml

-30
This file was deleted.

.github/workflows/publish-docker.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build Docker Image (and push to registry if main or staging)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- staging
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
build-and-push:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up QEMU
20+
uses: docker/setup-qemu-action@v3
21+
22+
- name: Setup buildx
23+
uses: docker/setup-buildx-action@v3
24+
with:
25+
platforms: linux/amd64,linux/arm64
26+
27+
- name: Docker meta
28+
id: meta
29+
uses: docker/metadata-action@v5
30+
with:
31+
images: ${{ secrets.DOCKER_USERNAME }}/graphql-api
32+
33+
- uses: actions/setup-node@v4
34+
with:
35+
node-version: 22
36+
37+
- name: Login to Docker Hub
38+
uses: docker/#-action@v3
39+
with:
40+
username: ${{ secrets.DOCKER_USERNAME }}
41+
password: ${{ secrets.DOCKER_PASSWORD }}
42+
43+
- name: Build and push Docker image
44+
uses: docker/build-push-action@v6
45+
with:
46+
context: .
47+
file: ./Dockerfile.dockerhub
48+
push: ${{ github.event_name != 'pull_request' }}
49+
tags: ${{ steps.meta.outputs.tags }}
50+
labels: ${{ steps.meta.outputs.labels }}
51+
platforms: linux/arm64

Dockerfile.dockerhub

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM node:22
2+
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
RUN npm ci
7+
8+
COPY . .
9+
10+
ARG SKIP_BUILD=false
11+
12+
RUN if [ "$SKIP_BUILD" = "false" ]; then npm run build; fi
13+
14+
CMD ["npm", "start"]

docker-compose.yml

-63
This file was deleted.

docker/events-processor-services.yml

-20
This file was deleted.

docker/graph-node-services.yml

-35
This file was deleted.

docker/services/app/Dockerfile

-21
This file was deleted.

docker/services/app/envfile

-12
This file was deleted.

docker/services/app/scripts/build-and-start-tests.sh

-7
This file was deleted.

docker/services/events-processor/Dockerfile

-18
This file was deleted.

docker/services/events-processor/envfile

-8
This file was deleted.

docker/services/fake-pinata/Dockerfile

-16
This file was deleted.

docker/services/subgraph-deployer/Dockerfile

-16
This file was deleted.

docker/services/subgraph-deployer/scripts/clone-subgraph.sh

-14
This file was deleted.

docker/services/subgraph-deployer/scripts/deploy-subgraph.sh

-17
This file was deleted.

docker/services/testnet/Dockerfile

-8
This file was deleted.
-538 KB
Binary file not shown.

docker/services/testnet/state/CURRENT

-1
This file was deleted.

docker/services/testnet/state/LOCK

Whitespace-only changes.

docker/services/testnet/state/LOG

-5
This file was deleted.

docker/services/testnet/state/LOG.old

-1
This file was deleted.
-117 Bytes
Binary file not shown.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
"test:e2e": "docker compose up --attach app --build --exit-code-from app && docker compose down",
1313
"build:graphql": "graphql-codegen",
1414
"build:contracts": "typechain --target=ethers-v6 --out-dir ./src/generated/contracts ./src/abi/**.json",
15-
"build": "./scripts/check-env-vars.sh && npm run build:contracts && npm run build:graphql && tsc",
15+
"build": "npm run build:contracts && npm run build:graphql && tsc",
1616
"dev": "npx nodemon",
17-
"start": "node dist/index.js",
17+
"start": "./scripts/check-env-vars.sh && node dist/index.js",
1818
"check": "tsc --noEmit"
1919
},
2020
"keywords": [],

0 commit comments

Comments
 (0)