Closed avoonix closed 1 year ago
tried a dockerfile with:
FROM alpine/git:latest RUN apk add --update nodejs npm WORKDIR /app RUN git clone https://github.com/avoonix/material-e621 RUN cd /app/material-e621 && npm install WORKDIR /app/material-e621 EXPOSE 5173 ENTRYPOINT ["npm", "run","dev","--", "--host", "0.0.0.0"]
and it's working. There seems to be only an issue with the loading of posts ( SyntaxError: import declarations may only appear at top level of a module in src/worker/ApiServiceWorker?type=module&worker_file )
npm run dev
is for the unoptimized development build, which sadly still doesn't work in Firefox (and some other browsers). Serving the output from npm run build
should work for everywhere.
great, "npm run build && npm run preview -- --host 0.0.0.0 --port 80" did work :-)
is it possible to automatically store a backup of the indexed-db on the server ? ( maybe with https://www.npmjs.com/package/vite-plugin-fs ? )
the only other things for a docker-image would be the option to customize the proxy-urls in this repo (maybe settings->proxy with a verify and save button ?) and the proxy-repo
is it possible to automatically store a backup of the indexed-db on the server ? ( maybe with https://www.npmjs.com/package/vite-plugin-fs ? )
Yes, since both https://github.com/avoonix/material-e621/blob/bdbdea12f6256572aeeb2fb712767c6371bf1cee/src/services/PersistanceService.ts#L29-L32 and https://github.com/avoonix/material-e621/blob/bdbdea12f6256572aeeb2fb712767c6371bf1cee/src/services/PersistanceService.ts#L33-L43 are async, you can just put network calls in there if you wish (maybe also debounce it). But that is not something I'd like to support out of the box.
i managed to do that :-) i think i need to create a fork for a private version of this
Added a nginx-version to his pull request
Thanks for all the input. I used your dockerfile as starting point, but ended up changing quite a bit. Let me know if any of the changes in cc751c8 or 534b7b7 don't work for you.
https://github.com/avoonix/material-e621/pkgs/container/material-e621
Instructions:
sudo docker run -d -p 8080:80 ghcr.io/avoonix/material-e621:latest
or
version: "3"
services:
app:
image: ghcr.io/avoonix/material-e621:latest
# if you want to build it yourself, replace `image` with `build`
# build:
# context: .
# dockerfile: Dockerfile
ports:
- 8080:80
Create a docker image for easier self hosting #2