Skip to content

Commit

Permalink
Upgrade versions (#97)
Browse files Browse the repository at this point in the history
* feature: upgrade node version to 18
prisma/prisma#14043 (comment)

* docs: add a documentation for docker

* chore: upgrade prisma version

* chore: upgrade nest and gql version
  • Loading branch information
Samox committed Mar 16, 2023
1 parent 41cb6b8 commit 960c495
Show file tree
Hide file tree
Showing 6 changed files with 836 additions and 254 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# syntax=docker/dockerfile:1
FROM --platform=linux/amd64 node:16.18.0-alpine as builder
FROM --platform=linux/amd64 node:18.15.0-alpine as builder
RUN apk add --update --no-cache openssl1.1-compat
USER node
WORKDIR /tmp/build/app

Expand All @@ -13,7 +14,7 @@ COPY --chown=node:node tsconfig.build.json ./
COPY --chown=node:node src ./src
RUN yarn build

FROM --platform=linux/amd64 node:16.18.0-alpine as ts-node-module-prod
FROM --platform=linux/amd64 node:18.15.0-alpine as ts-node-module-prod
USER node
WORKDIR /usr/src/app

Expand All @@ -23,7 +24,7 @@ RUN yarn install --frozen-lockfile --production
COPY --chown=node:node --from=builder /tmp/build/app/node_modules/@prisma ./node_modules/@prisma
COPY --chown=node:node --from=builder /tmp/build/app/node_modules/.prisma ./node_modules/.prisma

FROM --platform=linux/amd64 node:16.18.0-alpine
FROM --platform=linux/amd64 node:18.15.0-alpine
USER node
WORKDIR /usr/src/app
COPY --chown=node:node --from=builder /tmp/build/app/package.json ./
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,11 @@ payment-sandbox-webhooks => sandbox-2.org.com
MAX_STORED_WEBHOOKS_PER_HOST=100 # Will keep only 100 webhooks (per hosts)
DEFAULT_TARGETS=production.org.com, preproduction.org.com # Will send all the webhooks to these urls
```

# Using docker

Edit the docker.env

```
docker run --env-file ./docker.env -p 9000:9000 openwebhook/webhook-store:latest
```
23 changes: 23 additions & 0 deletions docker.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@


DATABASE_URL=postgresql://sammyteillet@host.docker.internal:5432/webhook-store?schema=public

# Storing Configuration

MAX_STORED_WEBHOOKS_PER_HOST=2000
DEFAULT_TARGETS=

PORT=9000

# Authentication Configuration
JWKS_URI=https://openwebhook-auth.herokuapp.com/.well-known/jwks.json
IS_PROTECTED=false
ADMIN_PASSWORD=

# File Storage Configuration

S3_BUCKET_NAME=
S3_BUCKET_ENDPOINT=
S3_BUCKET_PREFIX_PATH=
S3_BUCKET_ACCESS_KEY_ID=
S3_BUCKET_SECRET_ACCESS_KEY=
41 changes: 21 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,28 @@
"test:ci": "dotenv -e .env.test -- jest --silent --coverage"
},
"dependencies": {
"@nestjs/apollo": "^10.0.19",
"@apollo/server": "^4.5.0",
"@nestjs/apollo": "^11.0.3",
"@nestjs/axios": "^0.1.0",
"@nestjs/common": "^9.0.5",
"@nestjs/config": "^2.2.0",
"@nestjs/core": "^9.0.5",
"@nestjs/event-emitter": "^1.3.0",
"@nestjs/graphql": "^10.0.21",
"@nestjs/jwt": "^9.0.0",
"@nestjs/passport": "^9.0.0",
"@nestjs/platform-express": "^9.0.5",
"@nestjs/platform-ws": "^9.0.5",
"@nestjs/websockets": "^9.0.5",
"@prisma/client": "^4.2.1",
"apollo-server-express": "3.9.0",
"@nestjs/common": "^9.3.10",
"@nestjs/config": "^2.3.1",
"@nestjs/core": "^9.3.10",
"@nestjs/event-emitter": "^1.4.0",
"@nestjs/graphql": "^11.0.0",
"@nestjs/jwt": "^10.0.2",
"@nestjs/passport": "^9.0.3",
"@nestjs/platform-express": "^9.3.10",
"@nestjs/platform-ws": "^9.3.10",
"@nestjs/websockets": "^9.3.10",
"@prisma/client": "^4.11.0",
"apollo-server-express": "^3.12.0",
"aws-sdk": "^2.1183.0",
"axios": "^0.27.2",
"body-parser": "^1.20.0",
"express": "^4.18.1",
"express-xml-bodyparser": "^0.3.0",
"fp-ts": "^2.12.1",
"graphql": "16.5",
"graphql": "^16.6.0",
"graphql-subscriptions": "^2.0.0",
"http-proxy-middleware": "^2.0.6",
"io-ts": "^2.2.18",
Expand All @@ -63,19 +64,19 @@
"uuid": "^8.3.2"
},
"devDependencies": {
"@nestjs/cli": "^9.0.0",
"@nestjs/schematics": "^9.0.1",
"@nestjs/testing": "^9.0.5",
"@nestjs/cli": "^9.2.0",
"@nestjs/schematics": "^9.0.4",
"@nestjs/testing": "^9.3.10",
"@types/express": "^4.17.13",
"@types/express-xml-bodyparser": "^0.3.2",
"@types/jest": "27.4.1",
"@types/multer": "^1.4.7",
"@types/node": "^16.0.0",
"@types/passport-http": "^0.3.9",
"@types/passport-jwt": "^3.0.6",
"@types/passport-jwt": "^3.0.8",
"@types/supertest": "^2.0.11",
"@types/uuid": "^8.3.4",
"@types/ws": "^8.5.3",
"@types/ws": "^8.5.4",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"dotenv-cli": "^5.1.0",
Expand All @@ -84,7 +85,7 @@
"eslint-plugin-prettier": "^4.0.0",
"jest": "^27.2.5",
"prettier": "^2.3.2",
"prisma": "^4.2.1",
"prisma": "^4.11.0",
"source-map-support": "^0.5.20",
"supertest": "^6.1.3",
"ts-jest": "^27.0.3",
Expand Down
2 changes: 1 addition & 1 deletion src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import { GqlAuthGuard } from './interface/guards/gql-auth.guard';
},
'subscriptions-transport-ws': true,
},
context: ({ extra, ...rest }): WsContext | void | any => {
context: ({ extra, ...rest }: { extra: any }): WsContext | void | any => {
const extractedHost = extra ? extra.extractedHost : '';
return { extractedHost, ...rest };
},
Expand Down

0 comments on commit 960c495

Please sign in to comment.