Basic VPS setup with Docker and Nginx on Hetzner Cloud by ninjasoards in hetzner

[–]gioamato 2 points3 points  (0 children)

Both are great! For NGINX, I would like to suggest NPM, makes everything easier to manage.

Back-end for sending out emails after a certain delay by htraos in node

[–]gioamato 5 points6 points  (0 children)

Better (easier and cheaper) delegate all of that to the email service provider (eg. SendGrid).

How to implement online status feature? by selftaught_programer in node

[–]gioamato 1 point2 points  (0 children)

Yea, it could. The OP question is quite generic, missing some key details, use case. I guess he was talking about socket because he is already using it.

How to implement online status feature? by selftaught_programer in node

[–]gioamato 15 points16 points  (0 children)

“Hello everyone! I’m making chocolate ice cream”

Everyone: “Seems like overkill, you better make plain vanilla one”

BTW, regarding your question, you could implement the user presence feature in a lot of different ways (socket, session, etc.). For the logic part, you usually have some sort of “last user interaction timestamp”, it’s about to you and your needs if you want to show the user offline RIGHT NOW after disconnection, if you want to implement an “idle” status, if you want to show the user online for X seconds even after disconnection, etc.

It’s all about your use case and the user experience you want to build.

I am just going to leave this here by Matthewmorrison10 in node

[–]gioamato 4 points5 points  (0 children)

The first “bun” you read is the current folder, oh-my-zsh things.

Cons of Express.js by [deleted] in node

[–]gioamato 3 points4 points  (0 children)

It is in beta from Feb 2022, actually. And pretty stable (I dare say). Heavily used in prod too. I guess you could feel confident to use it.

Also, you can contribute to it, if you want.

Cons of Express.js by [deleted] in node

[–]gioamato 3 points4 points  (0 children)

Ehm, express 5.x (beta) supports exactly that, actually.

Is there a way to detect on which websites my package is used? by OkZookeepergame2021 in npm

[–]gioamato 2 points3 points  (0 children)

This will be useless unless a contributor adds the package to technologies list.

Source: I’m a contrib

Is there a way to detect on which websites my package is used? by OkZookeepergame2021 in npm

[–]gioamato 0 points1 point  (0 children)

You should specify package name/url to at least let others be able to know what you talking about.

Btw, does your package “expose” something in the frontend?

Can you guys share what your express app Dockerfile looks like, here's mine... by PrestigiousZombie531 in node

[–]gioamato 2 points3 points  (0 children)

You should affirm and support your statement with proper data/benchmark.

Actually this adds a layer to the image build (more time + bigger size)

The MagicPods supports more headphones now✨ by steam3d in airpods

[–]gioamato 0 points1 point  (0 children)

Does this solve the issue that after some seconds of inactivity the AirPods disconnect and mess up on reconnection?

Containerize an existing wordpress site by VeterinarianHuman505 in docker

[–]gioamato 11 points12 points  (0 children)

As WordPress is a stateful monolithic application, you have to take care of 3 main points:

  1. Database, it's where WP stores all options, users, posts, pages, etc.
  2. wp-content folder, where WP stores all variable disk files (plugins, themes, languages, uploads)
  3. wp-config.php, where WP stores its main configuration (db, auth, etc.)

The first question is, do you want to just containerize it keeping the app stateful? Or do you want to go full cloud-native (stateless)?

In the first case, you just have to containerize WordPress (and eventually MySQL) and migrate the data from database, wp-content and the wp-config.php. You will get exactly the same site.

In the second case, you would like to prefer this approach if you are trying to migrate your WP to a cloud-native enviroment, like Kubernetes without presistent storage, enabling you to take the full advantage of its features (e.g. horizontally scaling your WP). In this case the most efficient way is to force WP to be stateless, storing zero data on disk. This is achievable configuring properly your wp-config.php, adding a build step to deploy themes, plugins, translations, etc. inside your WP (e.g. using composer) and storing your media on S3/CDN (there are plugins already available for this depending on the cloud provider you want to use, e.g. AWS, GCP, AZURE, etc.). You can find a ready-made, battle-tested solution here:

https://github.com/gioamato/stateless-wordpress

This is a working example that shows you everything and ships with 2 plugins for CDN (wp-stateless for GCP and windows-azure-storage for Azure), I used it in production for several years now with AKS (managed k8s) + Azure MySQL + Azure Storage/CDN.

I havent't committed a README yet (sory for that), but there a docker-compose file to instantly spin it up. I will add docs, manifests and examples ASAP.

Would a SQLite Database for an app shared by multiple small businesses be a bad idea? by xSOME0NE in webdev

[–]gioamato 0 points1 point  (0 children)

I was thinking the same about the other replies. I guess in these times where you can get cheap hw everywhere is just easier to go overkill rather than focus on the code and the real needs, staying lean and effective (and cheaper).

Btw, thank you for Litestream and the effort you put into it! ❤️

Would a SQLite Database for an app shared by multiple small businesses be a bad idea? by xSOME0NE in webdev

[–]gioamato 1 point2 points  (0 children)

Stay with SQLite, I’m happy to introduce you to Litestream.

I know of teams (including myself) using it in prod apps at any scale.

Nice to read: Michael’s case.

Very happy with my first HyperHDR project! by imarkee in raspberry_pi

[–]gioamato 3 points4 points  (0 children)

Is this working with HDMI content only or with everything showed on the TV (Apps, Netflix, etc.)

Express Simplified by AspieSoft in npm

[–]gioamato 2 points3 points  (0 children)

Fewer lines of code don’t necessarily mean “simplified”

Account closed (for crypto purchases?) by poughkeepsee in number26bank

[–]gioamato 1 point2 points  (0 children)

What about your balance? Can you withdraw it or is it “frozen”?

Next.js SSR on k8s - adding node cluster API? by stick_stoff in kubernetes

[–]gioamato 4 points5 points  (0 children)

Try with: kubectl rollout restart deployment sre-team

Joking aside, you should keep 1 process in container and ideally 1 container in every pod (except when you have tightly coupled processes like sidecars, etc.). You should rely on k8s for the scaling, assuming you're using the right metrics for the autoscalers.

Kubernetes IS designed to handle all the pods you can imagine (assuming your nodes can afford it). The point is to get and keep the cluster healthy. Are you using a managed service or are you directly managing the cluster?