fix: improvements from testing

This commit is contained in:
Lucas Smith
2024-03-07 02:57:02 +00:00
parent 9525b9bd63
commit 10ef5b6e51
7 changed files with 54 additions and 18 deletions

View File

@@ -19,7 +19,6 @@
"@documenso/ee": "*", "@documenso/ee": "*",
"@documenso/lib": "*", "@documenso/lib": "*",
"@documenso/prisma": "*", "@documenso/prisma": "*",
"@documenso/tailwind-config": "*",
"@documenso/trpc": "*", "@documenso/trpc": "*",
"@documenso/ui": "*", "@documenso/ui": "*",
"@hookform/resolvers": "^3.1.0", "@hookform/resolvers": "^3.1.0",
@@ -46,18 +45,19 @@
"remeda": "^1.27.1", "remeda": "^1.27.1",
"sharp": "0.33.1", "sharp": "0.33.1",
"ts-pattern": "^5.0.5", "ts-pattern": "^5.0.5",
"typescript": "5.2.2",
"ua-parser-js": "^1.0.37", "ua-parser-js": "^1.0.37",
"uqr": "^0.1.2", "uqr": "^0.1.2",
"zod": "^3.22.4" "zod": "^3.22.4"
}, },
"devDependencies": { "devDependencies": {
"@documenso/tailwind-config": "*",
"@types/formidable": "^2.0.6", "@types/formidable": "^2.0.6",
"@types/luxon": "^3.3.1", "@types/luxon": "^3.3.1",
"@types/node": "20.1.0", "@types/node": "20.1.0",
"@types/react": "18.2.18", "@types/react": "18.2.18",
"@types/react-dom": "18.2.7", "@types/react-dom": "18.2.7",
"@types/ua-parser-js": "^0.7.39" "@types/ua-parser-js": "^0.7.39",
"typescript": "5.2.2"
}, },
"overrides": { "overrides": {
"next-auth": { "next-auth": {

View File

@@ -93,7 +93,18 @@ COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/standalone ./
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public COPY --from=installer --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public
# Get the start script from docker/start.sh # Copy the prisma binary, schema and migrations
COPY --chown=nextjs:nodejs /docker/start.sh . COPY --from=installer --chown=nextjs:nodejs /app/packages/prisma/schema.prisma ./packages/prisma/schema.prisma
COPY --from=installer --chown=nextjs:nodejs /app/packages/prisma/migrations ./packages/prisma/migrations
COPY --from=installer --chown=nextjs:nodejs /app/node_modules/prisma/ ./node_modules/prisma/
COPY --from=installer --chown=nextjs:nodejs /app/node_modules/@prisma/ ./node_modules/@prisma/
CMD start.sh # Symlink the prisma binary
RUN mkdir node_modules/.bin
RUN ln -s /app/node_modules/prisma/build/index.js ./node_modules/.bin/prisma
# Get the start script from docker/start.sh
COPY --chown=nextjs:nodejs ./docker/start.sh ./start.sh
CMD ["sh", "start.sh"]

View File

@@ -2,7 +2,7 @@ name: documenso-production
services: services:
database: database:
image: ?:15 image: postgres:15
environment: environment:
- POSTGRES_USER=${POSTGRES_USER:?err} - POSTGRES_USER=${POSTGRES_USER:?err}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?err} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?err}
@@ -18,7 +18,8 @@ services:
documenso: documenso:
image: documenso/documenso:latest image: documenso/documenso:latest
depends_on: depends_on:
- database database:
condition: service_healthy
environment: environment:
- PORT=${PORT:-3000} - PORT=${PORT:-3000}
- NEXTAUTH_URL=${NEXTAUTH_URL:-${NEXT_PUBLIC_WEBAPP_URL}} - NEXTAUTH_URL=${NEXTAUTH_URL:-${NEXT_PUBLIC_WEBAPP_URL}}

View File

@@ -1,5 +1,7 @@
#!/bin/sh #!/bin/sh
npx prisma migrate deploy --schema ./node_modules/.prisma/client/schema.prisma set -x
npx prisma migrate deploy --schema ./packages/prisma/schema.prisma
node apps/web/server.js node apps/web/server.js

View File

@@ -7,6 +7,11 @@ services:
- POSTGRES_USER=documenso - POSTGRES_USER=documenso
- POSTGRES_PASSWORD=password - POSTGRES_PASSWORD=password
- POSTGRES_DB=documenso - POSTGRES_DB=documenso
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U documenso']
interval: 1s
timeout: 5s
retries: 5
ports: ports:
- 54322:5432 - 54322:5432
@@ -22,12 +27,25 @@ services:
context: ../../ context: ../../
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile
depends_on: depends_on:
- database database:
- inbucket condition: service_healthy
inbucket:
condition: service_started
env_file: env_file:
- ../../.env.example - ../../.env.example
environment: environment:
- NEXTAUTH_SECRET=secret
- NEXT_PRIVATE_ENCRYPTION_KEY=CAFEBABE
- NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY=DEADBEEF
- NEXT_PRIVATE_DATABASE_URL=postgres://documenso:password@database:5432/documenso - NEXT_PRIVATE_DATABASE_URL=postgres://documenso:password@database:5432/documenso
- NEXT_PRIVATE_DIRECT_DATABASE_URL=postgres://documenso:password@database:5432/documenso - NEXT_PRIVATE_DIRECT_DATABASE_URL=postgres://documenso:password@database:5432/documenso
- NEXT_PUBLIC_UPLOAD_TRANSPORT=database
- NEXT_PRIVATE_SMTP_TRANSPORT=smtp-auth
- NEXT_PRIVATE_SMTP_HOST=inbucket
- NEXT_PRIVATE_SMTP_PORT=2500
- NEXT_PRIVATE_SMTP_USERNAME=documenso
- NEXT_PRIVATE_SMTP_PASSWORD=password
- NEXT_PRIVATE_SMTP_FROM_NAME="No Reply @ Documenso"
- NEXT_PRIVATE_SMTP_FROM_ADDRESS=noreply@documenso.com
ports: ports:
- 3000:3000 - 3000:3000

14
package-lock.json generated
View File

@@ -135,7 +135,6 @@
"@documenso/ee": "*", "@documenso/ee": "*",
"@documenso/lib": "*", "@documenso/lib": "*",
"@documenso/prisma": "*", "@documenso/prisma": "*",
"@documenso/tailwind-config": "*",
"@documenso/trpc": "*", "@documenso/trpc": "*",
"@documenso/ui": "*", "@documenso/ui": "*",
"@hookform/resolvers": "^3.1.0", "@hookform/resolvers": "^3.1.0",
@@ -162,18 +161,19 @@
"remeda": "^1.27.1", "remeda": "^1.27.1",
"sharp": "0.33.1", "sharp": "0.33.1",
"ts-pattern": "^5.0.5", "ts-pattern": "^5.0.5",
"typescript": "5.2.2",
"ua-parser-js": "^1.0.37", "ua-parser-js": "^1.0.37",
"uqr": "^0.1.2", "uqr": "^0.1.2",
"zod": "^3.22.4" "zod": "^3.22.4"
}, },
"devDependencies": { "devDependencies": {
"@documenso/tailwind-config": "*",
"@types/formidable": "^2.0.6", "@types/formidable": "^2.0.6",
"@types/luxon": "^3.3.1", "@types/luxon": "^3.3.1",
"@types/node": "20.1.0", "@types/node": "20.1.0",
"@types/react": "18.2.18", "@types/react": "18.2.18",
"@types/react-dom": "18.2.7", "@types/react-dom": "18.2.7",
"@types/ua-parser-js": "^0.7.39" "@types/ua-parser-js": "^0.7.39",
"typescript": "5.2.2"
} }
}, },
"apps/web/node_modules/@types/node": { "apps/web/node_modules/@types/node": {
@@ -225,6 +225,7 @@
"version": "5.2.2", "version": "5.2.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
"integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
"dev": true,
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
"tsserver": "bin/tsserver" "tsserver": "bin/tsserver"
@@ -9700,6 +9701,7 @@
"version": "16.3.1", "version": "16.3.1",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz",
"integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==",
"dev": true,
"engines": { "engines": {
"node": ">=12" "node": ">=12"
}, },
@@ -9711,6 +9713,7 @@
"version": "7.3.0", "version": "7.3.0",
"resolved": "https://registry.npmjs.org/dotenv-cli/-/dotenv-cli-7.3.0.tgz", "resolved": "https://registry.npmjs.org/dotenv-cli/-/dotenv-cli-7.3.0.tgz",
"integrity": "sha512-314CA4TyK34YEJ6ntBf80eUY+t1XaFLyem1k9P0sX1gn30qThZ5qZr/ZwE318gEnzyYP9yj9HJk6SqwE0upkfw==", "integrity": "sha512-314CA4TyK34YEJ6ntBf80eUY+t1XaFLyem1k9P0sX1gn30qThZ5qZr/ZwE318gEnzyYP9yj9HJk6SqwE0upkfw==",
"dev": true,
"dependencies": { "dependencies": {
"cross-spawn": "^7.0.3", "cross-spawn": "^7.0.3",
"dotenv": "^16.3.0", "dotenv": "^16.3.0",
@@ -9725,6 +9728,7 @@
"version": "10.0.0", "version": "10.0.0",
"resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-10.0.0.tgz", "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-10.0.0.tgz",
"integrity": "sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==", "integrity": "sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==",
"dev": true,
"engines": { "engines": {
"node": ">=12" "node": ">=12"
} }
@@ -21419,12 +21423,12 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@prisma/client": "5.4.2", "@prisma/client": "5.4.2",
"dotenv": "^16.3.1",
"dotenv-cli": "^7.3.0",
"prisma": "5.4.2", "prisma": "5.4.2",
"ts-pattern": "^5.0.6" "ts-pattern": "^5.0.6"
}, },
"devDependencies": { "devDependencies": {
"dotenv": "^16.3.1",
"dotenv-cli": "^7.3.0",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"typescript": "5.2.2" "typescript": "5.2.2"
} }

View File

@@ -19,12 +19,12 @@
}, },
"dependencies": { "dependencies": {
"@prisma/client": "5.4.2", "@prisma/client": "5.4.2",
"dotenv": "^16.3.1",
"dotenv-cli": "^7.3.0",
"prisma": "5.4.2", "prisma": "5.4.2",
"ts-pattern": "^5.0.6" "ts-pattern": "^5.0.6"
}, },
"devDependencies": { "devDependencies": {
"dotenv": "^16.3.1",
"dotenv-cli": "^7.3.0",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"typescript": "5.2.2" "typescript": "5.2.2"
} }