[GH-ISSUE #232] Defaul login and password in docker? #69

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

Originally created by @DeAlexPesh on GitHub (Jul 21, 2023).
Original GitHub issue: https://github.com/documenso/documenso/issues/232

image

Originally created by @DeAlexPesh on GitHub (Jul 21, 2023). Original GitHub issue: https://github.com/documenso/documenso/issues/232 ![image](https://github.com/documenso/documenso/assets/16735261/40e1621c-7d2f-4149-bbe1-4801c0acbffa)
kerem closed this issue 2026-02-26 18:45:13 +03:00
Author
Owner

@Mythie commented on GitHub (Jul 21, 2023):

Hey Alex, the default email/password is:

Email: example@documenso.com
Password: 123456789

I noticed we didn't have this in the README so I'll update that to include these details thanks! 😎

<!-- gh-comment-id:1645583175 --> @Mythie commented on GitHub (Jul 21, 2023): Hey Alex, the default email/password is: Email: example@documenso.com Password: 123456789 I noticed we didn't have this in the README so I'll update that to include these details thanks! 😎
Author
Owner

@DeAlexPesh commented on GitHub (Jul 24, 2023):

image

<!-- gh-comment-id:1647365858 --> @DeAlexPesh commented on GitHub (Jul 24, 2023): ![image](https://github.com/documenso/documenso/assets/16735261/38effbb2-dd82-45cf-bb46-00ca6da750e9)
Author
Owner

@ephraimduncan commented on GitHub (Jul 24, 2023):

Do you have the database running locally?

<!-- gh-comment-id:1647368245 --> @ephraimduncan commented on GitHub (Jul 24, 2023): Do you have the database running locally?
Author
Owner

@DeAlexPesh commented on GitHub (Jul 24, 2023):

Do you have the database running locally/

version: "3"
name: documenso
services:
 documenso:
  image: images/documenso:mode
  container_name: "documenso"
  ports:
   - "0.0.0.0:3000:3000"
  environment:
    - TZ=${TZ}
    - DATABASE_URL=postgres://${DB_USER}:${DB_PASS}@db:5432/${DB_NAME}
    - NEXT_PUBLIC_WEBAPP_URL=${NEXT_PUBLIC_WEBAPP_URL}
    - NEXTAUTH_URL=${NEXTAUTH_URL}
    - NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
    - NEXT_PUBLIC_ALLOW_SIGNUP=false
    - NEXT_PUBLIC_ALLOW_SUBSCRIPTIONS=false
    - SMTP_MAIL_HOST=${MAIL_HOST}
    - SMTP_MAIL_PORT=${MAIL_PORT}
    - SMTP_MAIL_USER=${MAIL_USER}
    - SMTP_MAIL_PASSWORD=${MAIL_PASSWORD}
    - MAIL_FROM=${MAIL_FROM}
  depends_on:
   documenso-db:
    condition: service_healthy
  links:
   - documenso-db:db
  networks:
   - documenso
  logging:
   driver: "json-file"
   options:
    max-size: "200k"
    max-file: "5"
  restart: always

 documenso-db:
  image: postgres:15-alpine
  container_name: "documenso-db"
  expose:
   - "5432"
  environment:
   - POSTGRES_USER=${DB_USER}
   - POSTGRES_PASSWORD=${DB_PASS}
   - POSTGRES_DB=${DB_NAME}
   - TZ=${TZ}
   - PGTZ=${TZ}
  volumes: 
   - "/app_base/documenso/db:/var/lib/postgresql/data"
  healthcheck:
   test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER} --quiet" ]
   start_period: 20s
   interval: 30s
   timeout: 10s
   retries: 10
  networks:
   - documenso
  logging:
   driver: "json-file"
   options:
    max-size: "200k"
    max-file: "5"
  restart: always

networks:
 documenso:
  driver: bridge
  name: documenso
<!-- gh-comment-id:1647374288 --> @DeAlexPesh commented on GitHub (Jul 24, 2023): > Do you have the database running locally/ ``` version: "3" name: documenso services: documenso: image: images/documenso:mode container_name: "documenso" ports: - "0.0.0.0:3000:3000" environment: - TZ=${TZ} - DATABASE_URL=postgres://${DB_USER}:${DB_PASS}@db:5432/${DB_NAME} - NEXT_PUBLIC_WEBAPP_URL=${NEXT_PUBLIC_WEBAPP_URL} - NEXTAUTH_URL=${NEXTAUTH_URL} - NEXTAUTH_SECRET=${NEXTAUTH_SECRET} - NEXT_PUBLIC_ALLOW_SIGNUP=false - NEXT_PUBLIC_ALLOW_SUBSCRIPTIONS=false - SMTP_MAIL_HOST=${MAIL_HOST} - SMTP_MAIL_PORT=${MAIL_PORT} - SMTP_MAIL_USER=${MAIL_USER} - SMTP_MAIL_PASSWORD=${MAIL_PASSWORD} - MAIL_FROM=${MAIL_FROM} depends_on: documenso-db: condition: service_healthy links: - documenso-db:db networks: - documenso logging: driver: "json-file" options: max-size: "200k" max-file: "5" restart: always documenso-db: image: postgres:15-alpine container_name: "documenso-db" expose: - "5432" environment: - POSTGRES_USER=${DB_USER} - POSTGRES_PASSWORD=${DB_PASS} - POSTGRES_DB=${DB_NAME} - TZ=${TZ} - PGTZ=${TZ} volumes: - "/app_base/documenso/db:/var/lib/postgresql/data" healthcheck: test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER} --quiet" ] start_period: 20s interval: 30s timeout: 10s retries: 10 networks: - documenso logging: driver: "json-file" options: max-size: "200k" max-file: "5" restart: always networks: documenso: driver: bridge name: documenso ```
Author
Owner

@ephraimduncan commented on GitHub (Jul 24, 2023):

Are you getting any errors? In the console or terminal?

<!-- gh-comment-id:1647375380 --> @ephraimduncan commented on GitHub (Jul 24, 2023): Are you getting any errors? In the console or terminal?
Author
Owner

@DeAlexPesh commented on GitHub (Jul 24, 2023):

Are you getting any errors? In the console or terminal?

Nope


> @documenso/web@0.1.0 start

> next start
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
{
  'process.env.NEXT_PUBLIC_ALLOW_SUBSCRIPTIONS': 'false',
  enabled: false,
  'subscription.status': undefined,
  'subscription.periodEnd': undefined
}
<!-- gh-comment-id:1647383109 --> @DeAlexPesh commented on GitHub (Jul 24, 2023): > Are you getting any errors? In the console or terminal? Nope ``` > @documenso/web@0.1.0 start  > next start ready - started server on 0.0.0.0:3000, url: http://localhost:3000 { 'process.env.NEXT_PUBLIC_ALLOW_SUBSCRIPTIONS': 'false', enabled: false, 'subscription.status': undefined, 'subscription.periodEnd': undefined } ```
Author
Owner

@ephraimduncan commented on GitHub (Jul 24, 2023):

What about the browser console?

<!-- gh-comment-id:1647387996 --> @ephraimduncan commented on GitHub (Jul 24, 2023): What about the browser console?
Author
Owner

@DeAlexPesh commented on GitHub (Jul 24, 2023):

What about the browser console?

image

<!-- gh-comment-id:1647389457 --> @DeAlexPesh commented on GitHub (Jul 24, 2023): > What about the browser console? ![image](https://github.com/documenso/documenso/assets/16735261/cd4e4791-7eac-4023-a136-32bf0292658a)
Author
Owner

@DeAlexPesh commented on GitHub (Jul 24, 2023):

maybe Dockerfile?

FROM node:18-alpine AS base
RUN apk add --no-cache git libc6-compat \
 && git clone https://github.com/documenso/documenso.git /home/documenso \
 && mv -f /home/documenso /app
WORKDIR /app

FROM base AS deps
RUN npm ci --production
 
FROM base AS build
RUN npm ci && npm run build --workspaces

FROM node:18-alpine AS production
WORKDIR /app
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --from=deps --chown=nextjs:nodejs /app/node_modules ./node_modules
COPY --from=deps --chown=nextjs:nodejs /app/package-lock.json ./package-lock.json
COPY --from=build --chown=nextjs:nodejs /app/apps/web/package.json ./package.json
COPY --from=build --chown=nextjs:nodejs /app/apps/web/public ./public
COPY --from=build --chown=nextjs:nodejs /app/apps/web/.next ./.next
EXPOSE 3000
ENV PORT 3000
CMD ["npm", "run", "start"]
<!-- gh-comment-id:1647406369 --> @DeAlexPesh commented on GitHub (Jul 24, 2023): maybe Dockerfile? ``` FROM node:18-alpine AS base RUN apk add --no-cache git libc6-compat \ && git clone https://github.com/documenso/documenso.git /home/documenso \ && mv -f /home/documenso /app WORKDIR /app FROM base AS deps RUN npm ci --production FROM base AS build RUN npm ci && npm run build --workspaces FROM node:18-alpine AS production WORKDIR /app ENV NODE_ENV production ENV NEXT_TELEMETRY_DISABLED 1 RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs COPY --from=deps --chown=nextjs:nodejs /app/node_modules ./node_modules COPY --from=deps --chown=nextjs:nodejs /app/package-lock.json ./package-lock.json COPY --from=build --chown=nextjs:nodejs /app/apps/web/package.json ./package.json COPY --from=build --chown=nextjs:nodejs /app/apps/web/public ./public COPY --from=build --chown=nextjs:nodejs /app/apps/web/.next ./.next EXPOSE 3000 ENV PORT 3000 CMD ["npm", "run", "start"] ```
Author
Owner

@DeAlexPesh commented on GitHub (Jul 24, 2023):

new error
image

  TypeError [ERR_INVALID_URL]: Invalid URL
    at new NodeError (node:internal/errors:405:5)
    at new URL (node:internal/url:611:13)
    at Object.redirect (/app/node_modules/next-auth/core/lib/default-callbacks.js:16:65)
    at createCallbackUrl (/app/node_modules/next-auth/core/lib/callback-url.js:20:35)
    at init (/app/node_modules/next-auth/core/init.js:131:48)
    at AuthHandler (/app/node_modules/next-auth/core/index.js:131:28)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async NextAuthApiHandler (/app/node_modules/next-auth/next/index.js:24:19)
    at async NextAuth._args$ (/app/node_modules/next-auth/next/index.js:110:14)
    at async Object.apiResolver (/app/node_modules/next/dist/server/api-utils/node.js:372:9) {
  input: 'undefined/',
  code: 'ERR_INVALID_URL'
}  
<!-- gh-comment-id:1647410566 --> @DeAlexPesh commented on GitHub (Jul 24, 2023): new error ![image](https://github.com/documenso/documenso/assets/16735261/da8b6597-3536-4ee2-b381-210b2ddd6dc5) ``` TypeError [ERR_INVALID_URL]: Invalid URL at new NodeError (node:internal/errors:405:5) at new URL (node:internal/url:611:13) at Object.redirect (/app/node_modules/next-auth/core/lib/default-callbacks.js:16:65) at createCallbackUrl (/app/node_modules/next-auth/core/lib/callback-url.js:20:35) at init (/app/node_modules/next-auth/core/init.js:131:48) at AuthHandler (/app/node_modules/next-auth/core/index.js:131:28) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async NextAuthApiHandler (/app/node_modules/next-auth/next/index.js:24:19) at async NextAuth._args$ (/app/node_modules/next-auth/next/index.js:110:14) at async Object.apiResolver (/app/node_modules/next/dist/server/api-utils/node.js:372:9) { input: 'undefined/', code: 'ERR_INVALID_URL' } ```
Author
Owner

@Mythie commented on GitHub (Jul 24, 2023):

G'day Alex, since you're using a custom docker compose setup it's a little harder to answer your query. When encountering the 500 error is anything being logged to the app container?

Also since you're using a custom setup it's likely that the database has not been seeded and thus has no users. In such a case you can add the NEXT_PUBLIC_ALLOW_SIGNUP=true env var to the compose file to allow signing up or alternatively run the seeding script npm run db-seed

<!-- gh-comment-id:1647445333 --> @Mythie commented on GitHub (Jul 24, 2023): G'day Alex, since you're using a custom docker compose setup it's a little harder to answer your query. When encountering the 500 error is anything being logged to the app container? Also since you're using a custom setup it's likely that the database has not been seeded and thus has no users. In such a case you can add the `NEXT_PUBLIC_ALLOW_SIGNUP=true` env var to the compose file to allow signing up or alternatively run the seeding script `npm run db-seed`
Author
Owner

@DeAlexPesh commented on GitHub (Jul 24, 2023):

npm run db-seed run only first run?
Can I autocreate admin user by entrypoint?

<!-- gh-comment-id:1647467030 --> @DeAlexPesh commented on GitHub (Jul 24, 2023): `npm run db-seed ` run only first run? Can I autocreate admin user by entrypoint?
Author
Owner

@Mythie commented on GitHub (Jul 24, 2023):

npm run db-seed run only first run? Can I autocreate admin user by entrypoint?

That's right just for a first run, our normal developer setup scripts handle this by default.

We will look into adding a guided setup for when there are no users (e.g. first time installs) the downside to doing that though is obviously if you aren't the first to access the deployment someone could create an admin user.

<!-- gh-comment-id:1647470306 --> @Mythie commented on GitHub (Jul 24, 2023): > `npm run db-seed ` run only first run? Can I autocreate admin user by entrypoint? That's right just for a first run, our normal developer setup scripts handle this by default. We will look into adding a guided setup for when there are no users (e.g. first time installs) the downside to doing that though is obviously if you aren't the first to access the deployment someone could create an admin user.
Author
Owner

@DeAlexPesh commented on GitHub (Jul 24, 2023):

Did not see these actions in your script
https://github.com/documenso/documenso/tree/main/docker

<!-- gh-comment-id:1647474151 --> @DeAlexPesh commented on GitHub (Jul 24, 2023): Did not see these actions in your script `https://github.com/documenso/documenso/tree/main/docker`
Author
Owner

@Mythie commented on GitHub (Jul 24, 2023):

This is handled by npm run dx or npm run d which chains together a few npm scripts 😅

<!-- gh-comment-id:1647475510 --> @Mythie commented on GitHub (Jul 24, 2023): This is handled by `npm run dx` or `npm run d` which chains together a few npm scripts 😅
Author
Owner

@DeAlexPesh commented on GitHub (Jul 24, 2023):

But where is your entrypoint or cmd with this script?
and npm run:

available via `npm run-script`:
  dev
    next dev
  build
    next build
  lint
    next lint
  db-studio
    prisma db studio
  stripe:listen
    stripe listen --forward-to localhost:3000/api/stripe/webhook

<!-- gh-comment-id:1647477579 --> @DeAlexPesh commented on GitHub (Jul 24, 2023): But where is your entrypoint or cmd with this script? and `npm run:` ``` available via `npm run-script`: dev next dev build next build lint next lint db-studio prisma db studio stripe:listen stripe listen --forward-to localhost:3000/api/stripe/webhook ```
Author
Owner

@DeAlexPesh commented on GitHub (Jul 24, 2023):

In such a case you can add the NEXT_PUBLIC_ALLOW_SIGNUP=true env var to the compose file to allow signing up or alternatively run the seeding script npm run db-seed

not work

<!-- gh-comment-id:1647807118 --> @DeAlexPesh commented on GitHub (Jul 24, 2023): > In such a case you can add the `NEXT_PUBLIC_ALLOW_SIGNUP=true` env var to the compose file to allow signing up or alternatively run the seeding script `npm run db-seed` not work
Author
Owner

@ephraimduncan commented on GitHub (Jul 24, 2023):

It seems like you're currently trying to run the application from the apps/web directory. However, to properly execute the command, you need to be in the project's root directory, which is documenso in this case.

# After you're done cloning the project
cd documenso
npm run d

The same should apply for the .env, add NEXT_PUBLIC_ALLOW_SIGNUP=true env var to the .env file in the root directory

<!-- gh-comment-id:1647877410 --> @ephraimduncan commented on GitHub (Jul 24, 2023): It seems like you're currently trying to run the application from the `apps/web` directory. However, to properly execute the command, you need to be in the project's root directory, which is `documenso` in this case. ```sh # After you're done cloning the project cd documenso npm run d ``` The same should apply for the `.env`, add `NEXT_PUBLIC_ALLOW_SIGNUP=true` env var to the `.env` file in the root directory
Author
Owner

@DeAlexPesh commented on GitHub (Jul 24, 2023):

i am trying to run this inside a docker after run:
docker exec -it documenso npm run d
image
becouse DB is a separate container

Maybe I can prepare the base in another normal way?
Running obscure scripts on a worked system is not the best way....

<!-- gh-comment-id:1648003423 --> @DeAlexPesh commented on GitHub (Jul 24, 2023): i am trying to run this inside a docker after run: `docker exec -it documenso npm run d` ![image](https://github.com/documenso/documenso/assets/16735261/5557b4ee-9c86-4ee8-a41e-2014a620f754) becouse DB is a separate container Maybe I can prepare the base in another normal way? Running obscure scripts on a worked system is not the best way....
Author
Owner

@Mythie commented on GitHub (Nov 3, 2023):

Closing as stale, I believe our dev setup is much better now however.

<!-- gh-comment-id:1791893395 --> @Mythie commented on GitHub (Nov 3, 2023): Closing as stale, I believe our dev setup is much better now however.
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#69
No description provided.