Template for extending Pocketbase with Go in a containerized environment via VSCode remote containers.
Requires the following local setup for development:
- Docker CE (19.03 or above)
- Docker Compose (1.25 or above)
- VSCode Extension: Remote - Containers (
ms-vscode-remote.remote-containers
)
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.
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/
Run CMD+SHIFT+P
Go: Install/Update Tools
after attaching to the container with VSCode to auto-install all golang related vscode extensions.
docker build . -t pocketbase-starter
docker run -v ./pb_data:/app/pb_data -p 8090:8090 pocketbase-starter
See the sample static manifests in deploy/
for a simple deployment to a Kubernetes cluster.
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!).
MIT © Mario Ranftl