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

@@ -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/public ./apps/web/public
# Get the start script from docker/start.sh
COPY --chown=nextjs:nodejs /docker/start.sh .
# Copy the prisma binary, schema and migrations
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:
database:
image: ?:15
image: postgres:15
environment:
- POSTGRES_USER=${POSTGRES_USER:?err}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?err}
@@ -18,7 +18,8 @@ services:
documenso:
image: documenso/documenso:latest
depends_on:
- database
database:
condition: service_healthy
environment:
- PORT=${PORT:-3000}
- NEXTAUTH_URL=${NEXTAUTH_URL:-${NEXT_PUBLIC_WEBAPP_URL}}

View File

@@ -1,5 +1,7 @@
#!/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

View File

@@ -7,6 +7,11 @@ services:
- POSTGRES_USER=documenso
- POSTGRES_PASSWORD=password
- POSTGRES_DB=documenso
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U documenso']
interval: 1s
timeout: 5s
retries: 5
ports:
- 54322:5432
@@ -22,12 +27,25 @@ services:
context: ../../
dockerfile: docker/Dockerfile
depends_on:
- database
- inbucket
database:
condition: service_healthy
inbucket:
condition: service_started
env_file:
- ../../.env.example
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_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:
- 3000:3000