Self-hosting on Docker · Issue #31 · stophecom/sharrr-svelte
github.com
external-link
Do you have any instructions on how to self-host this in Docker? Or is there an image somewhere to look? If not I can try to package it.

Has anyone ever tried to run sharrr in a container?

thelastknowngod
link
fedilink
English
51Y

There are build instructions in the readme. What’s stopping you?

@deleted@lemmy.world
link
fedilink
English
61Y

Knowledge?

I know how to deploy a container with docker compose but I don’t know how to build it.

I’m a .net developer and I didn’t even know you can build it into a container.

lemmyvore
link
fedilink
English
11Y

Read up on it a bit, it’s fairly easy. It’s similar to writing compose files but those are for using the image, dockerfiles are how you put it together. You get to decide very similar things to compose — what image to use, what ports to expose — but you also get to run commands to set up the insides of the image.

You do have to know a bit of Linux and how to setup the software you want to use though.

thelastknowngod
link
fedilink
English
131Y

You can do it bro. Dockerfiles are basically just shell scripts with a few extras.

It uses npm to build so start with a node base container. You can find them on docker hub. Alpine-based images are a good starting point.

FROM appdynamics/nodejs-agent:23.5.0-19-alpine 

RUN git clone https://github.com/stophecom/sharrr-svelte.git && \ 
    cd sharrr-svelt/ && \
    npm run build

If you need to access files from outside of the container, include a VOLUME line. If it needs to be accessible from a specific network port, add an EXPOSE line. Add a CMD line at the end to start whatever command needs to be run to start the process.

Save your Dockerfile and build.

docker build . -t my-sharrr-image
key
link
fedilink
English
61Y

I wouldn’t use AppD’s node agent as a starting point unless you’re planning to use AppD. Which you shouldn’t unless you’re a big business still talking about future plans to move to the cloud.

Picking a random image from dockerhub isn’t the best for security or reliability. You’re better off sticking to official images offered by a large, well known project. There’s even an official node image https://hub.docker.com/_/node/

thelastknowngod
link
fedilink
English
51Y

Figured this would be one of the responses. Thanks. I don’t interact with node very often. I assumed there was a better option but wasn’t sure which… This is just the first result.

@deleted@lemmy.world
link
fedilink
English
11Y

Definitely would look into it. Thanks

Create a post

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don’t control.

Rules:

  1. Be civil: we’re here to support and learn from one another. Insults won’t be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it’s not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don’t duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

  • 1 user online
  • 124 users / day
  • 419 users / week
  • 1.16K users / month
  • 3.85K users / 6 months
  • 1 subscriber
  • 3.68K Posts
  • 74.2K Comments
  • Modlog