~mathiash98


#53 Add Docker image support 1 year, 1 month ago

on ~timharek/hima

Great! I got it running on first try πŸ‘πŸ»

Btw I see that the "Home" property on user item in pocketbase-collection.json should be "required": true, instead of false:

{
"id": "omqrcfmh",
"name": "home",
"type": "relation",
"system": false,
"required": false,
"options": {
"collectionId": "4ao5ajhkksfa3fj",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": null,
"displayFields": []
}
},

Got "No backend or improperly setup" until I defined home prop

ons. 27. des. 2023 kl. 23:39 skrev ~timharek outgoing@sr.ht:

I added initial Docker support now in a seperate branch: https://git.sr.ht/~timharek/hima/commit/b0812bcc9e90f829e96526d86f7c6b31039102c3

Any thoughts ~mathiash98?

-- View on the web: https://todo.sr.ht/~timharek/hima/53#event-284100

#53 Add Docker image support 1 year, 1 month ago

Comment by ~mathiash98 on ~timharek/hima

Great! I got it running on first try πŸ‘πŸ»

Btw I see that the "Home" property on user item in pocketbase-collection.json should be "required": true, instead of false:

{
"id": "omqrcfmh",
"name": "home",
"type": "relation",
"system": false,
"required": false,
"options": {
"collectionId": "4ao5ajhkksfa3fj",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": null,
"displayFields": []
}
},

Got "No backend or improperly setup" until I defined home prop

ons. 27. des. 2023 kl. 23:39 skrev ~timharek outgoing@sr.ht:

I added initial Docker support now in a seperate branch: https://git.sr.ht/~timharek/hima/commit/b0812bcc9e90f829e96526d86f7c6b31039102c3

Any thoughts ~mathiash98?

-- View on the web: https://todo.sr.ht/~timharek/hima/53#event-284100

#53 Add Docker image support 1 year, 1 month ago

on ~timharek/hima

I added initial Docker support now in a seperate branch: https://git.sr.ht/~timharek/hima/commit/b0812bcc9e90f829e96526d86f7c6b31039102c3

Any thoughts ~mathiash98?

#53 Add Docker image support 1 year, 2 months ago

Comment by ~mathiash98 on ~timharek/hima

Yes hehe, sadly neither Pocketbase or Deno has progressed on docker support last 4 months, but it should not be too hard to make a docker image with the "unsupported deno image" that the official team recommends, and the pocketbase dockerfile they suggest on their website.

sΓΈn. 3. des. 2023 kl. 12:20 skrev ~timharek outgoing@sr.ht:

I think this will be useful to work on next. I'm switching VPS for my running instance of Hima and see that I've made myself a bunch of work instead of just having a Docker-image deployed πŸ˜…

-- View on the web: https://todo.sr.ht/~timharek/hima/53#event-276970

#53 Add Docker image support 1 year, 6 months ago

Comment by ~mathiash98 on ~timharek/hima

arm-version is mostly to let me actually build and run things on my local laptop with M1 processor.

So yes, the dockerfile that saaskit uses https://github.com/denoland/saaskit/blob/main/Dockerfile should work on x64 machines.

And pocketbase is possible to run in docker with following Dockerfile https://pocketbase.io/docs/going-to-production#using-docker. But then the users need to build these themselves...

#53 Add Docker image support 1 year, 6 months ago

Comment by ~mathiash98 on ~timharek/hima

Hmm deno does not publish any ARM64 images at this time... https://github.com/denoland/deno_docker/issues/100 Dockersupport is also quite poor where best practices are not followed; for example major and minor version https://github.com/denoland/deno_docker/issues/173

There is a 3rd party image built for all arches lukechannings/deno, so this can be used. But then Pocketbase does not have an official docker image neither... So we either need to build all these manually, use 3rd party images or just skip this all together...

Example of partially working Dockerfile:

# Deno does not officially produce arm64 images for Deno, using 3rd party
FROM lukechannings/deno

WORKDIR /app

# Deno does not have equivalent to `npm install` for some reason...
# So we need to copy all dependencies into the image before deno install
# This results in larger diff on docker image size
# We could add a deps.ts file which imports all dependencies,
# then run cache on that file. Which decrease build time.
# COPY deps.ts .
# RUN deno cache deps.ts

COPY . .

RUN deno cache main.ts

ARG PORT=3000
EXPOSE ${PORT}
ARG HOSTNAME=0.0.0.0
# Pocketbase does not have dockerfile, so we must connect to host machine
ARG PB_URL=http://host.docker.internal:8090
ARG ENVIRONMENT=production
ARG PB_USERNAME_ADMIN=admin@mail.com
ARG PB_PASSWORD_ADMIN=admin
ARG LANGUAGE=en-US
ARG CURRENCY=USD

ENV PORT=${PORT}
ENV HOSTNAME=${HOSTNAME}
ENV PB_URL=${PB_URL}
ENV ENVIRONMENT=${ENVIRONMENT}
ENV PB_USERNAME_ADMIN=${PB_USERNAME_ADMIN}
ENV PB_PASSWORD_ADMIN=${PB_PASSWORD_ADMIN}
ENV LANGUAGE=${LANGUAGE}
ENV CURRENCY=${CURRENCY}

CMD ["task", "start"]

Build with: docker build -f Dockerfile -t hima --build-arg PORT=8080 --build-arg PB_URL=127.0.0.1:8090 .

Run with: docker rm -f hima && docker run --rm -d --add-host=host.docker.internal:host-gateway -e PB_URL=http://host.docker.internal:8090 -e PB_USERNAME_ADMIN="pb-email" -e PB_PASSWORD_ADMIN="pb-pass" -p 8000:8000

#53 Add Docker image support 1 year, 6 months ago

Comment by ~mathiash98 on ~timharek/hima

I'll post a PR for this, should not take long time

#53 Add Docker image support 1 year, 6 months ago

on ~timharek/hima

Something you want to contribute with ~mathiash98?

#12 Bulk edit/add items 1 year, 6 months ago

Comment by ~mathiash98 on ~timharek/hima

Great suggestion

#41 Islands not working in production 1 year, 6 months ago

Ticket created by ~mathiash98 on ~timharek/hima

Network request:

Request URL:
https://hima.wyd.no/_frsh/js/7d9adf691e5d7e7468951af2b0920b29c8a56039/island-sortby.js
Request Method:
GET
Status Code:
500 Internal Server Error