Skip to content
/ pocketbase-starter Public template

DevContainer ENV for extending PocketBase with Go

License

Notifications You must be signed in to change notification settings

majodev/pocketbase-starter

Repository files navigation

github.com/majodev/pocketbase-starter

Template for extending Pocketbase with Go in a containerized environment via VSCode remote containers.

License: MIT Build and Test

Requirements

Requires the following local setup for development:

This project makes use of the Remote - Containers extension provided by Visual Studio Code. A local installation of Go/Pocketbase tool-chain is no longer required when using this setup.

Quickstart

Create a new git repository through the GitHub template repository feature (use this template). You will then start with a single initial commit in your own repository.

# First replace all occurances of 'github.com/majodev/pocketbase-starter' and then 'pocketbase-starter' with your own repository URI and project-name

# Then easily start the docker-compose dev environment through our helper
./docker-helper.sh --up

You should be inside the 'service' docker container with a bash shell.

development@94242c61cf2b:/app$ # inside your container...

# Shortcut for make init, make build, make info and make test
make all

# Print all available make targets
make help

# Start the pocketbase dev server pipeline and watch for changes to *.go files
# In this mode, all changes to *.go files will trigger a rebuild and restart of the service
# Use this mode also to create migrations from the superadmin UI (which will be automatically added to the ./migrations folder)
make watch

# See further docs here: https://pocketbase.io/docs/go-overview/

Visual Studio Code

Run CMD+SHIFT+P Go: Install/Update Tools after attaching to the container with VSCode to auto-install all golang related vscode extensions.

Production build

docker build . -t pocketbase-starter
docker run -v ./pb_data:/app/pb_data -p 8090:8090 pocketbase-starter

Kubernetes deployment

See the sample static manifests in deploy/ for a simple deployment to a Kubernetes cluster.

Uninstall

Simply run ./docker-helper --destroy in your working directory (on your host machine) to wipe all docker related traces of this project (and its volumes!).

Maintainers

License

MIT © Mario Ranftl