[GH-ISSUE #54] [DOC-218] Docker Container for Self-Hosting #24

Closed
opened 2026-02-26 18:45:00 +03:00 by kerem · 4 comments
Owner

Originally created by @ElTimuro on GitHub (Apr 7, 2023).
Original GitHub issue: https://github.com/documenso/documenso/issues/54

Originally assigned to: @ElTimuro on GitHub.

Currently beeing worked on. Feel free to leave feedback or ideas.

DOC-218

Originally created by @ElTimuro on GitHub (Apr 7, 2023). Original GitHub issue: https://github.com/documenso/documenso/issues/54 Originally assigned to: @ElTimuro on GitHub. Currently beeing worked on. Feel free to leave feedback or ideas. <sub>[DOC-218](https://linear.app/documenso/issue/DOC-218/docker-container-for-self-hosting)</sub>
kerem 2026-02-26 18:45:00 +03:00
  • closed this issue
  • added the
    roadmap
    label
Author
Owner

@treed593 commented on GitHub (Apr 27, 2023):

From testing:

  • Make sure migrations are included to run on container startup
  • The application should be able to run behind a Reverse Proxy
    • This could be my lack of experience with NextJS but, after the container starts and I get migrations run I am not able to login with a fresh user because of code: 'ERR_INVALID_URL'
<!-- gh-comment-id:1525974935 --> @treed593 commented on GitHub (Apr 27, 2023): From testing: - Make sure migrations are included to run on container startup - The application should be able to run behind a Reverse Proxy - This could be my lack of experience with NextJS but, after the container starts and I get migrations run I am not able to login with a fresh user because of `code: 'ERR_INVALID_URL'`
Author
Owner

@ElTimuro commented on GitHub (Apr 28, 2023):

<!-- gh-comment-id:1527773360 --> @ElTimuro commented on GitHub (Apr 28, 2023): - @treed593 thanks for the input - The Error is probably related to next auth, which needs the URL of the application. Did you set that? - See here for details: https://next-auth.js.org/configuration/options
Author
Owner

@treed593 commented on GitHub (May 31, 2023):

@ElTimuro yes I have that set, here is my docker-compose.

version: "3.3"

services:
  database:
    image: postgres:15
    environment:
      - POSTGRES_USER=documenso
      - POSTGRES_PASSWORD=<redacted>
      - POSTGRES_DB=documenso
    ports:
      - 5432:5432

  documenso:
    image: ghcr.io/pennerc/documenso:main
    command: npm run dev
    depends_on:
      - database
    environment:
      - DATABASE_URL=postgres://documenso:<redacted>@database:5432/documenso
      - NEXT_PUBLIC_WEBAPP_URL=https://sign.<redacted>.com
      - NEXTAUTH_SECRET=my-super-secure-secret
      - NEXTAUTH_URL=https://sign.<redacted>.com
      - NEXTAUTH_URL_INTERNAL=http://localhost:3000
      - SENDGRID_API_KEY=
      - SMTP_MAIL_HOST=smtp.gmail.com
      - SMTP_MAIL_PORT=587
      - SMTP_MAIL_USER=<redacted>
      - SMTP_MAIL_PASSWORD=<redacted>
      - MAIL_FROM=<redacted>
      - ALLOW_SIGNUP=true
      - NODE_ENV=production
    ports:
      - 3009:3000

I will try again with the updated repo though and see if it works now.

<!-- gh-comment-id:1570695511 --> @treed593 commented on GitHub (May 31, 2023): @ElTimuro yes I have that set, here is my docker-compose. ``` version: "3.3" services: database: image: postgres:15 environment: - POSTGRES_USER=documenso - POSTGRES_PASSWORD=<redacted> - POSTGRES_DB=documenso ports: - 5432:5432 documenso: image: ghcr.io/pennerc/documenso:main command: npm run dev depends_on: - database environment: - DATABASE_URL=postgres://documenso:<redacted>@database:5432/documenso - NEXT_PUBLIC_WEBAPP_URL=https://sign.<redacted>.com - NEXTAUTH_SECRET=my-super-secure-secret - NEXTAUTH_URL=https://sign.<redacted>.com - NEXTAUTH_URL_INTERNAL=http://localhost:3000 - SENDGRID_API_KEY= - SMTP_MAIL_HOST=smtp.gmail.com - SMTP_MAIL_PORT=587 - SMTP_MAIL_USER=<redacted> - SMTP_MAIL_PASSWORD=<redacted> - MAIL_FROM=<redacted> - ALLOW_SIGNUP=true - NODE_ENV=production ports: - 3009:3000 ``` I will try again with the updated repo though and see if it works now.
Author
Owner

@treed593 commented on GitHub (May 31, 2023):

@Mythie and @ElTimuro Now I get the following when running build.sh any ideas before I start digging

#14 [builder 4/5] RUN npm ci
#14 sha256:8ee633565509e04a661ae9a8e1a72ef6bf1b7980170e201abff67fc60dad3aa1
#14 170.9 npm notice
#14 170.9 npm notice New minor version of npm available! 9.5.1 -> 9.6.7
#14 170.9 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.6.7>
#14 170.9 npm notice Run `npm install -g npm@9.6.7` to update!
#14 170.9 npm notice
#14 171.0 npm ERR! code 1
#14 171.0 npm ERR! path /app/node_modules/turbo
#14 171.0 npm ERR! command failed
#14 171.0 npm ERR! command sh -c node install.js
#14 171.0 npm ERR! [turbo] Failed to find package "turbo-linux-64" on the file system
#14 171.0 npm ERR!
#14 171.0 npm ERR! This can happen if you use the "--no-optional" flag. The "optionalDependencies"
#14 171.0 npm ERR! package.json feature is used by turbo to install the correct binary executable
#14 171.0 npm ERR! for your current platform. This install script will now attempt to work around
#14 171.0 npm ERR! this. If that fails, you need to remove the "--no-optional" flag to use turbo.
#14 171.0 npm ERR!
#14 171.0 npm ERR! node:internal/modules/cjs/loader:1075
#14 171.0 npm ERR!   const err = new Error(message);
#14 171.0 npm ERR!               ^
#14 171.0 npm ERR!
#14 171.0 npm ERR! Error: Cannot find module 'turbo'
#14 171.0 npm ERR! Require stack:
#14 171.0 npm ERR! - /app/node_modules/turbo/node-platform.js
#14 171.0 npm ERR! - /app/node_modules/turbo/install.js
#14 171.0 npm ERR!     at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
#14 171.0 npm ERR!     at Function.resolve (node:internal/modules/cjs/helpers:116:19)
#14 171.0 npm ERR!     at downloadedBinPath (/app/node_modules/turbo/node-platform.js:47:44)
#14 171.0 npm ERR!     at checkAndPreparePackage (/app/node_modules/turbo/install.js:285:15)
#14 171.0 npm ERR!     at Object.<anonymous> (/app/node_modules/turbo/install.js:310:1)
#14 171.0 npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1254:14)
#14 171.0 npm ERR!     at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
#14 171.0 npm ERR!     at Module.load (node:internal/modules/cjs/loader:1117:32)
#14 171.0 npm ERR!     at Module._load (node:internal/modules/cjs/loader:958:12)
#14 171.0 npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
#14 171.0 npm ERR!   code: 'MODULE_NOT_FOUND',
#14 171.0 npm ERR!   requireStack: [
#14 171.0 npm ERR!     '/app/node_modules/turbo/node-platform.js',
#14 171.0 npm ERR!     '/app/node_modules/turbo/install.js'
#14 171.0 npm ERR!   ]
#14 171.0 npm ERR! }
#14 171.0 npm ERR!
#14 171.0 npm ERR! Node.js v18.16.0
#14 171.0
#14 171.0 npm ERR! A complete log of this run can be found in:
#14 171.0 npm ERR!     /root/.npm/_logs/2023-05-31T18_30_17_751Z-debug-0.log
#14 ERROR: executor failed running [/bin/sh -c npm ci]: exit code: 1
<!-- gh-comment-id:1570719745 --> @treed593 commented on GitHub (May 31, 2023): @Mythie and @ElTimuro Now I get the following when running `build.sh` any ideas before I start digging ``` #14 [builder 4/5] RUN npm ci #14 sha256:8ee633565509e04a661ae9a8e1a72ef6bf1b7980170e201abff67fc60dad3aa1 #14 170.9 npm notice #14 170.9 npm notice New minor version of npm available! 9.5.1 -> 9.6.7 #14 170.9 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.6.7> #14 170.9 npm notice Run `npm install -g npm@9.6.7` to update! #14 170.9 npm notice #14 171.0 npm ERR! code 1 #14 171.0 npm ERR! path /app/node_modules/turbo #14 171.0 npm ERR! command failed #14 171.0 npm ERR! command sh -c node install.js #14 171.0 npm ERR! [turbo] Failed to find package "turbo-linux-64" on the file system #14 171.0 npm ERR! #14 171.0 npm ERR! This can happen if you use the "--no-optional" flag. The "optionalDependencies" #14 171.0 npm ERR! package.json feature is used by turbo to install the correct binary executable #14 171.0 npm ERR! for your current platform. This install script will now attempt to work around #14 171.0 npm ERR! this. If that fails, you need to remove the "--no-optional" flag to use turbo. #14 171.0 npm ERR! #14 171.0 npm ERR! node:internal/modules/cjs/loader:1075 #14 171.0 npm ERR! const err = new Error(message); #14 171.0 npm ERR! ^ #14 171.0 npm ERR! #14 171.0 npm ERR! Error: Cannot find module 'turbo' #14 171.0 npm ERR! Require stack: #14 171.0 npm ERR! - /app/node_modules/turbo/node-platform.js #14 171.0 npm ERR! - /app/node_modules/turbo/install.js #14 171.0 npm ERR! at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15) #14 171.0 npm ERR! at Function.resolve (node:internal/modules/cjs/helpers:116:19) #14 171.0 npm ERR! at downloadedBinPath (/app/node_modules/turbo/node-platform.js:47:44) #14 171.0 npm ERR! at checkAndPreparePackage (/app/node_modules/turbo/install.js:285:15) #14 171.0 npm ERR! at Object.<anonymous> (/app/node_modules/turbo/install.js:310:1) #14 171.0 npm ERR! at Module._compile (node:internal/modules/cjs/loader:1254:14) #14 171.0 npm ERR! at Module._extensions..js (node:internal/modules/cjs/loader:1308:10) #14 171.0 npm ERR! at Module.load (node:internal/modules/cjs/loader:1117:32) #14 171.0 npm ERR! at Module._load (node:internal/modules/cjs/loader:958:12) #14 171.0 npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) { #14 171.0 npm ERR! code: 'MODULE_NOT_FOUND', #14 171.0 npm ERR! requireStack: [ #14 171.0 npm ERR! '/app/node_modules/turbo/node-platform.js', #14 171.0 npm ERR! '/app/node_modules/turbo/install.js' #14 171.0 npm ERR! ] #14 171.0 npm ERR! } #14 171.0 npm ERR! #14 171.0 npm ERR! Node.js v18.16.0 #14 171.0 #14 171.0 npm ERR! A complete log of this run can be found in: #14 171.0 npm ERR! /root/.npm/_logs/2023-05-31T18_30_17_751Z-debug-0.log #14 ERROR: executor failed running [/bin/sh -c npm ci]: exit code: 1 ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#24
No description provided.