diff --git a/src/pocketbase/.env.example b/src/pocketbase/.env.example new file mode 100644 index 0000000..9a74ef0 --- /dev/null +++ b/src/pocketbase/.env.example @@ -0,0 +1,3 @@ +PB_ENCRYPTION= +PB_ADMIN_EMAIL= +PB_ADMIN_PASSWORD= diff --git a/src/pocketbase/.gitignore b/src/pocketbase/.gitignore new file mode 100644 index 0000000..60a0926 --- /dev/null +++ b/src/pocketbase/.gitignore @@ -0,0 +1,2 @@ +/pb_hooks +/pb_public diff --git a/src/pocketbase/README.md b/src/pocketbase/README.md new file mode 100644 index 0000000..10684c7 --- /dev/null +++ b/src/pocketbase/README.md @@ -0,0 +1,3 @@ +# PocketBase + +PocketBase is an open source backend consisting of a realtime database, authentication, file storage and more. It can be used as a standalone app or embedded into your Go projects. diff --git a/src/pocketbase/docker-compose.yaml b/src/pocketbase/docker-compose.yaml new file mode 100644 index 0000000..a3cc03a --- /dev/null +++ b/src/pocketbase/docker-compose.yaml @@ -0,0 +1,47 @@ +x-default: &default + restart: unless-stopped + volumes: + - &localtime /etc/localtime:/etc/localtime:ro + - &timezone /etc/timezone:/etc/timezone:ro + logging: + driver: json-file + options: + max-size: 100m + +services: + pocketbase: + <<: *default + image: ghcr.io/muchobien/pocketbase:${PB_VERSION:-0.30.0} + environment: + # Optional ENCRYPTION (Ensure this is a 32-character long encryption key) + # $ openssl rand -hex 16 + # https://pocketbase.io/docs/going-to-production/#enable-settings-encryption + ENCRYPTION: ${PB_ENCRYPTION} + PB_ADMIN_EMAIL: ${PB_ADMIN_EMAIL:-admin@example.com} + PB_ADMIN_PASSWORD: ${PB_ADMIN_PASSWORD:-supersecret123} + ports: + - "${PB_PORT:-8090}:8090" + volumes: + - *localtime + - *timezone + - pb_data:/pb_data + + # optional public and hooks folders + - ./pb_public:/pb_public + - ./pb_hooks:/pb_hooks + healthcheck: # optional, recommended since v0.10.0 + test: wget --no-verbose --tries=1 --spider http://localhost:8090/api/health || exit 1 + interval: 5s + timeout: 5s + retries: 5 + deploy: + resources: + limits: + cpus: '0.25' + memory: 256M + reservations: + cpus: '0.1' + memory: 128M + +volumes: + pb_data: