MaxLeiter / Drift

Drift is a self-hostable Gist and paste service. Built with Next.js 13 and React Server Components.
https://drift.lol
MIT License
1.36k stars 61 forks source link

[Feature Request] Single Docker image #126

Open rklos opened 2 years ago

rklos commented 2 years ago

Hi, I came here to ask about single Docker image for the whole Drift project.

Why:

Current Drift's Docker setup requires two separate instances - one for frontend and one for backend. It's quite good option for development team because debugging can be much easier. But for "casual user" there is no need to expose this detail about split of the project. It will be much easier, for everyone who wants to just host it, if there is only one Docker image which contains backend and frontend.

What I need:

An option to run only one Docker image instead of two separate ones.

I know that you @MaxLeiter will be busy with porting Drift to Next 13, so I can try to make a "monolith" Docker image in my spare time.

MaxLeiter commented 2 years ago

Good timing, I just set to work on a next 13 rewrite of the front-end.

In the current setup there are some issues with static site generation relying on the server being available, which isn't possible with a single docker image. The front-end rewrite will remove that reliance, but as pointed out by @jazcarate in #79, there's room to significantly improve the server as well.

However, I think a larger rewrite of the server/API would be beneficial. I chose sequelize at the time because of my familiarity with it, but I've now tried prisma and typeorm and they're both leagues ahead of sequelize-ts's typings.

If you have any interest in lending a hand in the server or client refactor let me know here or in #drift on libera.chat.

tl;dr: a single docker image will be doable after the first pass of my work (which will take a bit of time), but it's not a priority of mine until the server has been cleaned up.

rklos commented 2 years ago

I haven't got familiar with your code, also can't promise a high availability. But if there are any low priority tasks, I can do a few of them in my spare time. I can do both server and client, but I'm more proficient with frontend.

MyWay commented 1 year ago

Once you have the docker image published, can't you just use the docker-compose.yml?