Skip to content

[Feature]: Docker Image #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
avoonix opened this issue Jan 16, 2023 · 8 comments
Closed

[Feature]: Docker Image #3

avoonix opened this issue Jan 16, 2023 · 8 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@avoonix
Copy link
Owner

avoonix commented Jan 16, 2023

Create a docker image for easier self hosting #2

@avoonix avoonix added the enhancement New feature or request label Jan 16, 2023
@avoonix avoonix assigned avoonix and unassigned avoonix Jan 16, 2023
@avoonix avoonix added the good first issue Good for newcomers label Jan 16, 2023
@tamaskan
Copy link
Contributor

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 )

@avoonix
Copy link
Owner Author

avoonix commented Jan 17, 2023

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.

@tamaskan
Copy link
Contributor

tamaskan commented Jan 17, 2023

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 ? )

@tamaskan
Copy link
Contributor

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

avoonix added a commit that referenced this issue Mar 23, 2023
- Settings > API & Account (see #3)
@avoonix
Copy link
Owner Author

avoonix commented Mar 23, 2023

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

public async saveState() {
await this.saveToLocalStorage("state", this.main.$state);
log("saved state");
}
and
public async loadState() {
const savedState = await this.getFromLocalStorage<ISettingsServiceState>(
"state",
);
if (savedState?.snackbar) {
savedState.snackbar = null;
}
if (savedState) {
this.setState(savedState);
}
}
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.

@tamaskan
Copy link
Contributor

i managed to do that :-) i think i need to create a fork for a private version of this

@Forgenn Forgenn mentioned this issue Apr 8, 2023
@tamaskan
Copy link
Contributor

Added a nginx-version to his pull request

@avoonix
Copy link
Owner Author

avoonix commented May 20, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants