{"id":14975876,"url":"https://github.com/sonyarianto/pocketbase-docker","last_synced_at":"2025-05-12T17:23:42.218Z","repository":{"id":86857866,"uuid":"529739236","full_name":"sonyarianto/pocketbase-docker","owner":"sonyarianto","description":"Pocketbase in the form of Docker container. Just for my personal scenario, but maybe can inspire others.","archived":false,"fork":false,"pushed_at":"2025-01-02T07:09:21.000Z","size":106,"stargazers_count":39,"open_issues_count":0,"forks_count":18,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-12T17:23:30.917Z","etag":null,"topics":["docker","dockercompose","golang","nginx","pocketbase","reverseproxy","sqlite3"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sonyarianto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"sonyarianto","custom":["https://paypal.me/sonyarianto"]}},"created_at":"2022-08-28T02:01:47.000Z","updated_at":"2025-03-20T12:47:08.000Z","dependencies_parsed_at":"2023-09-24T11:31:18.055Z","dependency_job_id":"96c4b93b-0370-45e0-b745-4ed325b4f4f1","html_url":"https://github.com/sonyarianto/pocketbase-docker","commit_stats":{"total_commits":144,"total_committers":2,"mean_commits":72.0,"dds":0.02083333333333337,"last_synced_commit":"a67c4f02ed7d55ff5c9071eab1e717e1beb36ab4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonyarianto%2Fpocketbase-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonyarianto%2Fpocketbase-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonyarianto%2Fpocketbase-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonyarianto%2Fpocketbase-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sonyarianto","download_url":"https://codeload.github.com/sonyarianto/pocketbase-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253785187,"owners_count":21963926,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","dockercompose","golang","nginx","pocketbase","reverseproxy","sqlite3"],"created_at":"2024-09-24T13:52:48.155Z","updated_at":"2025-05-12T17:23:42.195Z","avatar_url":"https://github.com/sonyarianto.png","language":"Dockerfile","funding_links":["https://github.com/sponsors/sonyarianto","https://paypal.me/sonyarianto"],"categories":["Docker"],"sub_categories":[],"readme":"# pocketbase-docker\n\nDockerized [Pocketbase](https://github.com/pocketbase/pocketbase).\n\n## Technical Notes\n\nThe most important file is `Dockerfile` that define the image and later for build the image purpose, and there is `docker-compose.yml` to make it easy to run or build with Docker Compose.\n\n- Read the `Dockerfile`. That's the core file to build the image.\n- Pocketbase will expose port `8090` inside the container (as defined on `Dockerfile` file).\n- Pocketbase will use volume called `pocketbase-volume` for data persistent storage (as defined in `docker-compose.yml`).\n- Pocketbase will use `/app/data/pb_data` to store data and `/app/data/pb_public` to store data that public facing to users, such as HTML, CSS, images, JS etc. \n- Update `POCKETBASE_VERSION` on `Dockerfile` to the latest version. See the latest version number at at https://github.com/pocketbase/pocketbase/releases. I will try to update the version number as often as I can.\n\n## Docker Compose (typical scenario)\n\nThis is for you that need to quickly spin up Pocketbase and run on your host (localhost or on cloud). You can adjust it. As you can see, I define `volumes` to make data persistent if you stop the container.\n\n```\nservices:\n  pocketbase:\n    container_name: pocketbase\n    build: .\n    image: pocketbase:latest\n    volumes:\n      - pocketbase-volume:/app/data\n    ports:\n      - \"8090:8090\"\n\nvolumes:\n  pocketbase-volume:\n    name: pocketbase-volume\n```\n\nRun it with `docker compose up -d`. At this point we already can run Pocketbase on http://localhost:8090/.\n- Admin page go to http://localhost:8090/_/\n- API URI on the http://localhost:8090/api/\n\nRun `docker inspect pocketbase` for more details.\n\nIf you don't want to expose the port to host, just remove or comment the `ports` section above.\n\n## Nginx config (using reverse proxy)\n\nLet say you have domain `example.com` and you already create subdomain `api.example.com` to server your Pocketbase infrastructure. I assume you already setup the SSL certificate as well (I am using Cloudflare DNS so SSL is already provided).\n\n```\nserver {\n  listen 80;\n  listen [::]:80;\n  \n  server_name api.example.com; # adjust this to your domain\n\n  return 301 https://api.example.com$request_uri; # adjust this to your URI\n}\n\nserver {\n  listen 443 ssl;\n  listen [::]:443 ssl;\n\n  server_name api.example.com; # adjust this to your domain\n\n  location / {\n    proxy_set_header Connection '';\n    proxy_http_version 1.1;\n    proxy_read_timeout 180s;\n\n    proxy_set_header Host $host;\n    proxy_set_header X-Real-IP $remote_addr;\n    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n    proxy_set_header X-Forwarded-Proto $scheme;\n    proxy_set_header X-Forwarded-By $remote_addr;\n\n    proxy_pass http://pocketbase:8090; # this is pointing to service name on the Docker Compose, adjust it when necessary\n  }\n\n  ssl_certificate /just_example_of_selfsigned.crt; # adjust this with your situation\n  ssl_certificate_key /just_example_of_selfsigned.key; # adjust this with your situation\n}\n```\n\nAt this point you will have Pocketbase on https://api.example.com\n\nRemember https://api.example.com/_/ to access the Admin page and https://api.example.com/api/ is the API endpoint.\n\n## Nginx config (using reverse proxy and using base path)\n\nThis scenario will assume you have URL https://api.example.com/ (similar like previous Nginx scenario) but the Pocketbase will be on the base path called `pocketbase` so the end result will be like https://api.example.com/pocketbase\n\n```\nserver {\n  listen 80;\n  listen [::]:80;\n  \n  server_name api.example.com; # adjust this to your domain\n\n  return 301 https://api.example.com$request_uri; # adjust this to your URI\n}\n\nserver {\n  listen 443 ssl;\n  listen [::]:443 ssl;\n\n  server_name api.example.com; # adjust this to your domain\n\n  location /pocketbase { # adjust this base path when necessary\n    rewrite /pocketbase/(.*) /$1  break; # adjust this rewrite when necessary\n\n    proxy_set_header Connection '';\n    proxy_http_version 1.1;\n    proxy_read_timeout 180s;\n\n    proxy_set_header Host $host;\n    proxy_set_header X-Real-IP $remote_addr;\n    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n    proxy_set_header X-Forwarded-Proto $scheme;\n    proxy_set_header X-Forwarded-By $remote_addr;\n\n    proxy_pass http://pocketbase:8090; # this is pointing to service name on the Docker Compose, adjust it when necessary\n  }\n\n  ssl_certificate /your_path_to_ssl_files/just_example_of_selfsigned.crt; # adjust this with your situation\n  ssl_certificate_key /your_path_to_ssl_files/just_example_of_selfsigned.key; # adjust this with your situation\n}\n```\n\nAt this point you will have Pocketbase on https://api.example.com/pocketbase\n\nRemember https://api.example.com/pocketbase/_/ to access the Admin page and https://api.example.com/pocketbase/api/ is the API endpoint.\n\n## Questions\n\nIf you still have any question please feel free to write to me on Discussions section above.\n\n## Credits\n\nInspired and based on:\n\n- https://github.com/krushiraj/pocketbase-docker/blob/main/Dockerfile\n- https://github.com/bscott/pocketbase-docker/blob/main/Dockerfile\n- https://github.com/muchobien/pocketbase-docker\n- https://github.com/pocketbase/pocketbase/issues/92\n\nCredits to [Gani Georgiev](https://github.com/ganigeorgiev) who created Pocketbase, it's great piece of software.\n\n## License\n\nMIT\n\nMaintained by Sony Arianto Kurniawan \u003c\u003csony@sony-ak.com\u003e\u003e and contributors.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonyarianto%2Fpocketbase-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsonyarianto%2Fpocketbase-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonyarianto%2Fpocketbase-docker/lists"}