Sign inSign up

mussingtonr/pocketbase

By mussingtonr

•Updated 5 months ago

Pocketbase docker that updates automatically to the latest version. Standard and Dokploy versions.

Image
Buildkit cache
Databases & storage
1

9.7K

mussingtonr/pocketbase repository overview

⁠PocketBase Docker Image

Docker Image Version PocketBase Version Docker Image Size Docker Pulls GitHub

I've created this auto-updating Docker image for PocketBase⁠. The image is specifically designed for Dokploy⁠ deployments, as the current Dokploy templates for PocketBase weren't meeting my needs.

Pulling mussingtonr/pocketbase:latest will automatically retrieve the correct image for your architecture.

⁠Supported Architectures

This image supports multiple architectures, so you can run it on various platforms:

  • linux/amd64 - x86-64
  • linux/arm64 - ARM64
  • linux/arm/v7 - ARMv7

⁠What is PocketBase?

This Docker image is a build of pocketbase.io⁠ - Open Source backend for your next SaaS and Mobile app in 1 file.

⁠Application Setup

Access the web UI at <your-ip>:8090, for more information check out PocketBase⁠.

⁠Volume Directories

I've configured the image to support multiple directories that are mounted into the container. These folders are mapped to the root inside the container:

  • pb_data (Required) - Holds your application config and data. This should be mapped to your local file system to persist them!
  • pb_public (Optional) - Used for serving static files. Supported in PocketBase since version 0.20.7
  • pb_migrations (Optional) - Allows you to version your DB structure. See https://pocketbase.io/docs/js-migrations/⁠. Supported in PocketBase since version 0.20.8
  • pb_hooks (Optional) - Allows you to add custom JavaScript hooks for extending functionality. See https://pocketbase.io/docs/js-overview/⁠

⁠Environment Variables

I've added support for several environment variables to make the image more configurable:

VariableDescriptionRequiredDefault
POCKETBASE_ADMIN_EMAILAdmin user email. When set with password, automatically creates or updates the admin user on startupOptional-
POCKETBASE_ADMIN_PASSWORDAdmin user passwordOptional-
POCKETBASE_ENCRYPTION_KEYEncrypts application settings in the database (OAuth2 secrets, SMTP passwords, etc.)Optional-
POCKETBASE_PORTServer port numberOptional8090
POCKETBASE_DATA_DIRData directory pathOptional/pb_data
POCKETBASE_PUBLIC_DIRStatic files directory pathOptional/pb_public
POCKETBASE_MIGRATIONS_DIRMigrations directory pathOptional/pb_migrations
POCKETBASE_HOOKS_DIRHooks directory pathOptional/pb_hooks

⁠Usage

⁠Standard Deployment

I've included a basic docker-compose.yml⁠ file for standard deployments:

services:
  pocketbase:
    image: mussingtonr/pocketbase:latest
    container_name: pocketbase
    restart: unless-stopped
    ports:
      - "8090:8090"
    volumes:
      - /path/to/data:/pb_data
      - /path/to/public:/pb_public        # Optional
      - /path/to/migrations:/pb_migrations # Optional
      - /path/to/hooks:/pb_hooks          # Optional
    environment:
      - TZ=America/New_York
      # Optional: Uncomment to auto-create admin user
      # - [email protected]
      # - POCKETBASE_ADMIN_PASSWORD=your-secure-password
      # Optional: Uncomment to encrypt sensitive settings
      # - POCKETBASE_ENCRYPTION_KEY=your-32-character-key

⁠Dokploy Deployment

I've created a dedicated docker-compose.dokploy.yml⁠ template specifically for Dokploy deployments. This template uses Dokploy's standard volume path structure.

services:
  pocketbase:
    image: mussingtonr/pocketbase:latest
    restart: unless-stopped
    pull_policy: always
    ports:
      - "8090:8090"
    volumes:
      - ../files/pb_data:/pb_data
      - ../files/pb_public:/pb_public
      - ../files/pb_migrations:/pb_migrations
      - ../files/pb_hooks:/pb_hooks
    environment:
      # Timezone configuration
      - TZ=America/New_York
    
      # Optional: Admin user credentials
      # Uncomment and set these to automatically create/update an admin user
      # - [email protected]
      # - POCKETBASE_ADMIN_PASSWORD=your-secure-password-here
    
      # Optional: Encryption key for securing settings in the database
      # Generate a secure random key: openssl rand -base64 32
      # - POCKETBASE_ENCRYPTION_KEY=your-encryption-key-here

⁠Updates

The Docker image is automatically built daily via GitHub Actions. It always contains the latest PocketBase version. You don't need to manually check for updates - just pull the latest image.

⁠License

This Docker image configuration is provided as-is. PocketBase itself is licensed under the MIT License.

Tag summary

Content type

Image

Digest

sha256:5397fa20d…

Size

16.2 MB

Last updated

5 months ago

docker pull mussingtonr/pocketbase