security-union / videocall-rs

teleconference system written in rust
https://www.videocall.rs
MIT License
1.36k stars 117 forks source link

[FEAT]: Optimize Docker #69

Closed ImBIOS closed 1 year ago

ImBIOS commented 1 year ago

📈 What's Improved?

image

✅ Objective

### Mandatory
- [x] Able to build production docker containers with multi-stage build technique
- [x] Production docker containers with multi-stage build technique running properly
- [x] Able to build development docker containers
- [x] Development docker containers running properly
- [x] Document on how to run production containers
- [x] Document on how to run development containers
### Optional
- [x] Able to run Dev Container
ImBIOS commented 1 year ago

The first step of #68

ImBIOS commented 1 year ago

@griffobeid @darioalessandro I think it's ready for review now.

I think #71 and this PR should be discussed, what's the main purpose to achieve in this containerization? Are we going to combine dev and prod environment, or we will split it so each one optimized for each purpose?

griffobeid commented 1 year ago

@griffobeid @darioalessandro I think it's ready for review now.

I think #71 and this PR should be discussed, what's the main purpose to achieve in this containerization? Are we going to combine dev and prod environment, or we will split it so each one optimized for each purpose?

I think we can have them both together in the same Dockerfile and optimize for each purpose simultaneously by using multi-stage builds. I like to use three stages, development which contains all of the development resources, build which inherits from the development container but also contains the source code, and finally, the production container which is just a slim OS image and any system-level dependencies that the application requires.

I prefer this approach because we have fewer Dockerfiles to update which can often lead to dev and production Dockerfiles going out of sync on some versions.

So I guess the ask is could you reduce the number of Dockerfiles and also docker-compose yaml files? I would prefer to have 1 docker-compose.yaml and a single Dockerfile for each application

ImBIOS commented 1 year ago

@griffobeid I love your idea ⭐

I just need to sync and cook that idea, my current progress, and the current main branch containerization progress.

It'll be great developer experience to have a maintainable source code 👍

darioalessandro commented 1 year ago

Hey @ImBIOS thank you so much for your contributions!

  1. would it be possible only to merge the docker-compose changes for dev purposes? We are using helm in prod with a different set of Docker images.
  2. Can we split this PR into smaller PRs? I saw some changes that confused me like a vscode config file I think?
griffobeid commented 1 year ago

Hey @ImBIOS are you still working on this?