This repository contains the necessary code to set up and deploy an Internet Speed website. This project is written in C# (ASP.NET Core) and is optimized for deployment on cloud servers using Docker and Docker Compose.
Before starting the deployment process, ensure the following tools are installed and correctly configured on your server:
- Docker Engine: Docker Installation Guide
- Docker Compose: Docker Compose Installation Guide
- .NET 8 SDK and Runtime: Download .NET 8
Before building the Docker images, it is critical to replace the following values in the respective files with your own server and domain information.
-
SSL Certificate Paths: In the
volumessection for the application service, you must map the actual paths of your SSL certificate files (e.g.,fullchain.crtandprivkey.key) on the host server to the paths inside the container.volumes: - /root/example.crt:/https/example.crt:ro - /root/example.key:/https/example.key:ro
-
SSL Certificate Paths: Enter the paths that you mapped into the container in
docker-compose.yml(e.g.,/https/fullchain.crt) into the Kestrel settings. -
API Key: Enter the required API key (if any) in the corresponding field (Your-api-key).
"Certificate": { "Path": "/https/example.crt", "KeyPath": "/https/example.key" "PiNetwork": { "ApiKey": "Your-api-key"
- SSL Paths: If there are any
COPYcommands or direct references to SSL paths within theDockerfile, ensure they also match your configuration. (Often, these settings are managed indocker-compose.ymlandappsettings.json, but it's essential to check this file as well).
Important Note: Failure to set the SSL paths correctly will prevent the site from loading over HTTPS or cause the Docker container to fail upon execution.
After you have correctly configured all values in the files above, open a terminal in the project's root directory (where the docker-compose.yml file is located) and run the following commands in order:
This command will download the .NET 8 image, build your project, and create the final image based on the Dockerfile.
docker-compose buildThis command will run your containers in detached mode (in the background) based on the docker-compose.yml settings.
docker-compose up -dCongratulations! 🎉 Your website should now be accessible on the domain you configured.