Skip to content

[Improve] Shrink docker image size #299

@Soulter

Description

@Soulter

Hi, thank you for your great work on WeekToDo! While reviewing the Dockerfile, I noticed that it currently uses yarn serve to run the application inside the container. However, this approach has some drawbacks:

Large Image Size: Since yarn serve runs a development server, the final Docker image includes unnecessary dependencies and results in a larger size.
Slow Startup Time: The container needs to start a Node.js process each time, making it slower to boot.
Inefficient Static File Serving: The built-in development server is not optimized for production use, whereas Nginx provides better performance and caching mechanisms.
Suggested Improvement:
To optimize the Docker image, I suggest using a multi-stage build approach:

Use a Node.js container to install dependencies and build the static files.
Use a lightweight Nginx container to serve the built static files efficiently.

I can work for this if you think this is good.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions