Skip to content

Documentation: Self-hosting guide via Docker Compose is incomplete and fails to deploy #463

@hkfires

Description

@hkfires

Description

I followed the self-hosting guide at https://happy.engineering/docs/guides/self-hosting/ to deploy the server using Docker Compose, but the provided configuration is incomplete and results in multiple runtime crashes.

Steps to Reproduce

  1. Copy the docker-compose.yml from the documentation.
  2. Run docker-compose up.

Issues Encountered

1. Missing MinIO/S3 Configuration

The application crashes immediately on startup with InvalidEndpointError because it requires an S3-compatible storage service, but the provided docker-compose.yml does not include a MinIO service, nor does the documentation mention how to configure the required S3 environment variables (S3_HOST, S3_BUCKET, etc.).

Error Log:
/app/node_modules/minio/dist/esm/internal/client.ts:238
throw new errors.InvalidEndpointError(Invalid endPoint : ${params.endPoint})
InvalidEndpointError: Invalid endPoint : undefined

2. Missing Encryption Key

After manually fixing the S3 issue, the application crashes again due to a missing HANDY_MASTER_SECRET environment variable, which is required for privacy-kit.

Error Log:
TypeError [ERR_INVALID_ARG_TYPE]: The "password" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, or DataView. Received undefined
at Object.deriveSecureKey (file:///app/node_modules/privacy-kit/dist/index.mjs:2440:16)

3. Database Schema Not Initialized

The guide does not mention that database migrations need to be run manually. The container starts but logs continuous errors because the database tables do not exist.

Error Log:
Invalid prisma.account.count() invocation:
The table public.Account does not exist in the current database.

4. Incorrect Networking

The DATABASE_URL and REDIS_URL in the provided example use localhost, which fails within the Docker network. They should point to the service names (postgres and redis).

Suggested Fix

Please update the documentation and the provided docker-compose.yml to:

  1. Include a MinIO service configuration.
  2. Add necessary environment variables (S3_*, HANDY_MASTER_SECRET).
  3. Correct the network hostnames for Postgres and Redis.
  4. Add instructions to run npx prisma migrate deploy after the containers are up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions