Initial commit
This commit is contained in:
BIN
pocketbase/.DS_Store
vendored
Normal file
BIN
pocketbase/.DS_Store
vendored
Normal file
Binary file not shown.
23
pocketbase/Dockerfile
Executable file
23
pocketbase/Dockerfile
Executable file
@@ -0,0 +1,23 @@
|
||||
FROM alpine:latest
|
||||
ARG PB_VERSION=0.34.2
|
||||
RUN apk --no-cache add curl
|
||||
RUN adduser -s /bin/bash -D pocketbase
|
||||
|
||||
USER pocketbase
|
||||
|
||||
WORKDIR /home/pocketbase
|
||||
RUN curl -LJ "https://github.com/pocketbase/pocketbase/releases/download/v${PB_VERSION}/pocketbase_${PB_VERSION}_linux_amd64.zip" -o pb.zip
|
||||
RUN unzip pb
|
||||
RUN rm pb.zip
|
||||
|
||||
RUN mkdir pb_data
|
||||
RUN mkdir pb_hooks
|
||||
RUN mkdir pb_migrations
|
||||
RUN mkdir pb_public
|
||||
|
||||
EXPOSE 8090
|
||||
|
||||
COPY --chown=pocketbase --chmod=700 ./pb_data/ ./pb_hooks/ ./pb_migrations/ ./pb_public/
|
||||
COPY --chown=pocketbase --chmod=700 ./initialize.sh .
|
||||
|
||||
ENTRYPOINT [ "./initialize.sh" ]
|
||||
22
pocketbase/initialize.sh
Executable file
22
pocketbase/initialize.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Starting PocketBase initialization..."
|
||||
|
||||
DB_FILE="./pb_data/data.db"
|
||||
|
||||
# Step 1: Ensure the database file exists
|
||||
if [ ! -f "$DB_FILE" ]; then
|
||||
# echo "Database not found. Copying default data..."
|
||||
# cp -r ./pb_data_default/. ./pb_data/
|
||||
# This is only needed if we don't copy the default data
|
||||
./pocketbase serve --http 0.0.0.0:8090 --automigrate=0 & sleep 4
|
||||
kill $(pidof pocketbase)
|
||||
|
||||
# Creates the admin user or updates if already exists
|
||||
echo "Creating admin user"
|
||||
./pocketbase superuser upsert "$POCKETBASE_ADMIN_USERNAME" "$POCKETBASE_ADMIN_PASSWORD"
|
||||
fi
|
||||
|
||||
# Step 3: Start PocketBase normally
|
||||
echo "Starting PocketBase..."
|
||||
./pocketbase serve --http 0.0.0.0:8090
|
||||
BIN
pocketbase/pb_data/auxiliary.db
Normal file
BIN
pocketbase/pb_data/auxiliary.db
Normal file
Binary file not shown.
BIN
pocketbase/pb_data/data.db
Normal file
BIN
pocketbase/pb_data/data.db
Normal file
Binary file not shown.
23849
pocketbase/pb_data/types.d.ts
vendored
Normal file
23849
pocketbase/pb_data/types.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
pocketbase/pb_migrations/.DS_Store
vendored
Normal file
BIN
pocketbase/pb_migrations/.DS_Store
vendored
Normal file
Binary file not shown.
113
pocketbase/pb_migrations/1765427500_created_media.js
Normal file
113
pocketbase/pb_migrations/1765427500_created_media.js
Normal file
@@ -0,0 +1,113 @@
|
||||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((app) => {
|
||||
const collection = new Collection({
|
||||
"createRule": null,
|
||||
"deleteRule": null,
|
||||
"fields": [
|
||||
{
|
||||
"autogeneratePattern": "[a-z0-9]{15}",
|
||||
"hidden": false,
|
||||
"id": "text3208210256",
|
||||
"max": 15,
|
||||
"min": 15,
|
||||
"name": "id",
|
||||
"pattern": "^[a-z0-9]+$",
|
||||
"presentable": false,
|
||||
"primaryKey": true,
|
||||
"required": true,
|
||||
"system": true,
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"autogeneratePattern": "",
|
||||
"hidden": false,
|
||||
"id": "text724990059",
|
||||
"max": 0,
|
||||
"min": 0,
|
||||
"name": "title",
|
||||
"pattern": "",
|
||||
"presentable": false,
|
||||
"primaryKey": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"autogeneratePattern": "",
|
||||
"hidden": false,
|
||||
"id": "text3145888567",
|
||||
"max": 0,
|
||||
"min": 0,
|
||||
"name": "year",
|
||||
"pattern": "",
|
||||
"presentable": false,
|
||||
"primaryKey": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"autogeneratePattern": "",
|
||||
"hidden": false,
|
||||
"id": "text762383602",
|
||||
"max": 0,
|
||||
"min": 0,
|
||||
"name": "poster",
|
||||
"pattern": "",
|
||||
"presentable": false,
|
||||
"primaryKey": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"autogeneratePattern": "",
|
||||
"hidden": false,
|
||||
"id": "text3458754147",
|
||||
"max": 0,
|
||||
"min": 0,
|
||||
"name": "summary",
|
||||
"pattern": "",
|
||||
"presentable": false,
|
||||
"primaryKey": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "autodate2990389176",
|
||||
"name": "created",
|
||||
"onCreate": true,
|
||||
"onUpdate": false,
|
||||
"presentable": false,
|
||||
"system": false,
|
||||
"type": "autodate"
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "autodate3332085495",
|
||||
"name": "updated",
|
||||
"onCreate": true,
|
||||
"onUpdate": true,
|
||||
"presentable": false,
|
||||
"system": false,
|
||||
"type": "autodate"
|
||||
}
|
||||
],
|
||||
"id": "pbc_2708086759",
|
||||
"indexes": [],
|
||||
"listRule": null,
|
||||
"name": "media",
|
||||
"system": false,
|
||||
"type": "base",
|
||||
"updateRule": null,
|
||||
"viewRule": null
|
||||
});
|
||||
|
||||
return app.save(collection);
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_2708086759");
|
||||
|
||||
return app.delete(collection);
|
||||
})
|
||||
71
pocketbase/pb_migrations/1765428919_created_genres.js
Normal file
71
pocketbase/pb_migrations/1765428919_created_genres.js
Normal file
@@ -0,0 +1,71 @@
|
||||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((app) => {
|
||||
const collection = new Collection({
|
||||
"createRule": null,
|
||||
"deleteRule": null,
|
||||
"fields": [
|
||||
{
|
||||
"autogeneratePattern": "[a-z0-9]{15}",
|
||||
"hidden": false,
|
||||
"id": "text3208210256",
|
||||
"max": 15,
|
||||
"min": 15,
|
||||
"name": "id",
|
||||
"pattern": "^[a-z0-9]+$",
|
||||
"presentable": false,
|
||||
"primaryKey": true,
|
||||
"required": true,
|
||||
"system": true,
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"autogeneratePattern": "",
|
||||
"hidden": false,
|
||||
"id": "text1579384326",
|
||||
"max": 0,
|
||||
"min": 0,
|
||||
"name": "name",
|
||||
"pattern": "",
|
||||
"presentable": false,
|
||||
"primaryKey": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "autodate2990389176",
|
||||
"name": "created",
|
||||
"onCreate": true,
|
||||
"onUpdate": false,
|
||||
"presentable": false,
|
||||
"system": false,
|
||||
"type": "autodate"
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "autodate3332085495",
|
||||
"name": "updated",
|
||||
"onCreate": true,
|
||||
"onUpdate": true,
|
||||
"presentable": false,
|
||||
"system": false,
|
||||
"type": "autodate"
|
||||
}
|
||||
],
|
||||
"id": "pbc_2683869272",
|
||||
"indexes": [],
|
||||
"listRule": null,
|
||||
"name": "genres",
|
||||
"system": false,
|
||||
"type": "base",
|
||||
"updateRule": null,
|
||||
"viewRule": null
|
||||
});
|
||||
|
||||
return app.save(collection);
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_2683869272");
|
||||
|
||||
return app.delete(collection);
|
||||
})
|
||||
28
pocketbase/pb_migrations/1765429148_updated_genres.js
Normal file
28
pocketbase/pb_migrations/1765429148_updated_genres.js
Normal file
@@ -0,0 +1,28 @@
|
||||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_2683869272")
|
||||
|
||||
// update collection data
|
||||
unmarshal({
|
||||
"createRule": "",
|
||||
"deleteRule": "",
|
||||
"listRule": "",
|
||||
"updateRule": "",
|
||||
"viewRule": ""
|
||||
}, collection)
|
||||
|
||||
return app.save(collection)
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_2683869272")
|
||||
|
||||
// update collection data
|
||||
unmarshal({
|
||||
"createRule": null,
|
||||
"deleteRule": null,
|
||||
"listRule": null,
|
||||
"updateRule": null,
|
||||
"viewRule": null
|
||||
}, collection)
|
||||
|
||||
return app.save(collection)
|
||||
})
|
||||
28
pocketbase/pb_migrations/1765429605_updated_media.js
Normal file
28
pocketbase/pb_migrations/1765429605_updated_media.js
Normal file
@@ -0,0 +1,28 @@
|
||||
/// <reference path="../pb_data/types.d.ts" />
|
||||
migrate((app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_2708086759")
|
||||
|
||||
// add field
|
||||
collection.fields.addAt(5, new Field({
|
||||
"cascadeDelete": false,
|
||||
"collectionId": "pbc_2683869272",
|
||||
"hidden": false,
|
||||
"id": "relation2834031894",
|
||||
"maxSelect": 999,
|
||||
"minSelect": 0,
|
||||
"name": "genres",
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "relation"
|
||||
}))
|
||||
|
||||
return app.save(collection)
|
||||
}, (app) => {
|
||||
const collection = app.findCollectionByNameOrId("pbc_2708086759")
|
||||
|
||||
// remove field
|
||||
collection.fields.removeById("relation2834031894")
|
||||
|
||||
return app.save(collection)
|
||||
})
|
||||
BIN
pocketbase/pb_public/.DS_Store
vendored
Normal file
BIN
pocketbase/pb_public/.DS_Store
vendored
Normal file
Binary file not shown.
Reference in New Issue
Block a user