-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(graph): adds Dockerfile and docker-compose.yaml
- Loading branch information
Showing
11 changed files
with
452 additions
and
261 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
'@kadena/graph': minor | ||
--- | ||
|
||
Adds improvements to run as stand-alone as well as in Docker | ||
- adds postinstall script to install the platform specific Prisma engines | ||
- adds a Dockerfile to build from NPM deployed @kadena/graph package | ||
- adds a Dockerfile to build from source |
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,112 @@ | ||
.git | ||
|
||
################################################## | ||
### Below is the same as .gitignore | ||
################################################## | ||
|
||
# build artefacts | ||
packages/*/*/lib | ||
packages/*/*/lib-commonjs | ||
packages/*/*/.parcel-cache | ||
packages/*/*/dist | ||
packages/*/*/coverage | ||
|
||
# lock-files that don't belong here | ||
package-lock.json | ||
yarn.lock | ||
npm-shrinkwrap.json | ||
shrinkwrap.json | ||
|
||
# Metadata | ||
tsdoc-metadata.json | ||
|
||
# Logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables files | ||
.env | ||
# direnv | ||
.envrc | ||
|
||
# next.js build output | ||
.next | ||
|
||
# OS X temporary files | ||
.DS_Store | ||
|
||
packages/*/*/temp | ||
# Heft | ||
.heft | ||
|
||
# Pact command history | ||
.pact-history | ||
|
||
# Intelij idea files | ||
.idea | ||
.idea/* | ||
|
||
# Turborepo | ||
.turbo | ||
|
||
# Storybook static build | ||
storybook-static | ||
|
||
temp | ||
|
||
#Playwright | ||
/packages/*/*/test-results | ||
/packages/*/*/playwright-report | ||
/packages/*/*/blob-report | ||
# cache-sh | ||
.cache-sh | ||
|
||
# parcel | ||
.parcel-cache |
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,20 @@ | ||
# This dockerfile is using @kadena/graph from NPM | ||
FROM node:20-bookworm-slim AS build | ||
|
||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
RUN corepack enable | ||
|
||
WORKDIR /app | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y openssl | ||
|
||
RUN pnpm i -g @prisma/engines prisma | ||
RUN pnpm i -g @kadena/graph | ||
|
||
# empty to satisfy checks | ||
RUN mkdir /app/cwd-extra-migrations | ||
|
||
EXPOSE 4000 | ||
CMD ["kadena-graph"] |
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,23 @@ | ||
services: | ||
graphql-source: | ||
image: kadena/devnet | ||
ports: | ||
- "4000:4000" | ||
env_file: .env | ||
environment: | ||
- NODE_ENV=production | ||
build: | ||
context: ../../../ | ||
dockerfile: ./packages/apps/graph/source.Dockerfile | ||
|
||
# build with `docker compose build graphql` | ||
# run with `docker compose up graphql` | ||
graphql: | ||
image: kadena/devnet | ||
ports: | ||
- "4000:4000" | ||
env_file: .env | ||
environment: | ||
- NODE_ENV=production | ||
build: | ||
dockerfile: Dockerfile |
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,24 @@ | ||
FROM node:20-bookworm-slim AS build | ||
|
||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
RUN corepack enable | ||
RUN pnpm i -g turbo | ||
|
||
WORKDIR /app | ||
COPY ./../../../ . | ||
|
||
RUN pnpm install --filter @kadena/graph... | ||
RUN turbo run build --filter @kadena/graph^... | ||
RUN turbo run build --filter @kadena/graph | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y openssl | ||
RUN apt-get install -y ssh | ||
RUN apt-get install -y byobu | ||
RUN apt-get install -y postgresql-client | ||
|
||
RUN cd packages/apps/graph && pnpm run prisma:generate | ||
|
||
EXPOSE 4000 | ||
CMD ["node", "./packages/apps/graph/dist/index.js"] |
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
Oops, something went wrong.