Skip to content

This guide explains how to host an HTML file using Caddy Server running on a Docker container based on Nano Server.

License

Notifications You must be signed in to change notification settings

melihacikgoz/caddynano-server-container

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Migrating from Server Core with Nginx to Nano Server with Caddy Server

This document outlines the migration process from a Docker image based on Server Core with Nginx to Nano Server with Caddy Server, emphasizing the significant reduction in image size and dependencies.

Why Choose Nano Server and Caddy Server?

Advantages of Caddy Server

•	Easy Installation: Operates with a single binary file.
•	Automatic HTTPS: Built-in Let’s Encrypt integration for automatic TLS certificates.
•	Minimal Dependencies: Requires no additional modules or libraries.
•	Simplified Configuration: Uses a straightforward and readable Caddyfile for setup.

Advantages of Nano Server

•	Lightweight: Significantly smaller footprint compared to Server Core.
•	Reduced Surface Area: Fewer components reduce vulnerability risks.
•	Minimal Dependencies: Excludes unnecessary services and features.
•	Optimized for Containers: Designed specifically for container-based applications.

Migration Process

Challenges with Server Core + Nginx

•	High Dependency Count: Nginx requires additional modules and libraries for most configurations.
•	Large Image Size: Server Core images often exceed several gigabytes.
•	Complex Configuration: Nginx can require advanced setup for certain use cases.

Performance and Storage Comparison Switching to Nano Server and Caddy Server offers a lightweight and efficient alternative to Server Core with Nginx. It also eliminates the need for complex dependency management.

Conclusion

Using Nano Server with Caddy Server is a strategic choice for containerized applications, offering: 1. Significant reduction in storage requirements. 2. Simplified configuration and maintenance. 3. Enhanced performance through minimal dependencies.

By transitioning from Server Core to Nano Server, projects benefit from reduced image size, faster deployment, and improved overall efficiency.

Notes: 1. The files inside src/* can be JavaScript files and may include frameworks or libraries such as React, Angular, Vue, etc.

How To Run?

First Step: docker build -t caddynano-server .

Second Step: docker run -d -p 80:80 -p 443:443 caddynano-server

Accessing the Application

Once the container is running, open your browser and navigate to:

If HTTPS is required, a certificate must be installed. OpenSSL is supported for generating and managing certificates.

These URLs will point to the application running inside the Docker container.

About

This guide explains how to host an HTML file using Caddy Server running on a Docker container based on Nano Server.

Topics

Resources

License

Stars

Watchers

Forks