-
Notifications
You must be signed in to change notification settings - Fork 258
feat(srv): add doc on how to deploy website MTA-6545 #5596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
761c8ff
feat(srv): add doc on how to deploy website MTA-6545
SamyOubouaziz 228ed40
feat(srv): update
SamyOubouaziz 6e8c9bb
feat(srv): update
SamyOubouaziz bb1302f
feat(srv): update
SamyOubouaziz f256422
feat(srv): update
SamyOubouaziz 95afd3d
feat(srv): update
SamyOubouaziz 3e98c47
feat(srv): update
SamyOubouaziz 7d36f0c
feat(srv): update
SamyOubouaziz 243d958
feat(srv): update
SamyOubouaziz 7a83e6e
feat(srv): update
SamyOubouaziz 6c746f4
feat(srv): update
SamyOubouaziz 4542f17
feat(srv): update
SamyOubouaziz 1737f34
feat(srv): update
SamyOubouaziz 9c8ffdd
feat(srv): update
SamyOubouaziz 3a81da9
Apply suggestions from code review
SamyOubouaziz c58ddc2
Apply suggestions from code review
SamyOubouaziz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
tutorials/hosting-static-websites-serverless-containers/index.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| --- | ||
| title: Hosting a static website with Serverless Containers | ||
| description: This page provides guidelines on how to host and deploy a static website using Scaleway Serverless Containers | ||
| tags: deploy host website webapp html static containerize application docker dockerfile | ||
| products: | ||
| - containers | ||
| - container-registry | ||
| dates: | ||
| validation: 2025-10-06 | ||
| posted: 2025-10-06 | ||
| validation_frequency: 12 | ||
| difficulty: beginner | ||
| usecase: | ||
| - application-hosting | ||
| - deploy-external-software | ||
| - website-hosting | ||
| ecosystem: | ||
| - third-party | ||
| --- | ||
|
|
||
| import Requirements from '@macros/iam/requirements.mdx' | ||
|
|
||
|
|
||
| <Requirements /> | ||
|
|
||
| - A Scaleway account logged into the [console](https://console.scaleway.com) | ||
| - [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization | ||
| - Installed [Docker](https://docs.docker.com/get-started/get-docker/) or [Docker Egine](https://docs.docker.com/engine/install/) | ||
| - [Created a Scaleway Container Registry namespace](/container-registry/how-to/create-namespace/) and [logged into it](/container-registry/how-to/connect-docker-cli/) | ||
|
|
||
| ## Create and host a simple HTML static page | ||
|
|
||
| To host a static HTML page on Serverless Containers, you first need to create a simple HTML page that will serve as your website. Next, you will write a Dockerfile to containerize your application, specifying how your HTML file should be served. You will then build the container image locally, and push it to the [Scaleway Container Registry](/container-registry/), before deploying it to [Scaleway Serverless Containers](/serverless-containers/). | ||
|
|
||
| 1. In a terminal, run the command below to create a new folder and access it: | ||
|
|
||
| ```bash | ||
| mkdir my-static-website | ||
| cd my-static-website | ||
| ``` | ||
|
|
||
| 2. Create a new `index.html` file and add the example code below to it: | ||
|
|
||
| ```html | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <title>Simple HTML Page</title> | ||
| </head> | ||
| <body> | ||
| <h1>Hello World</h1> | ||
| <p>This is a simple paragraph.</p> | ||
| </body> | ||
| </html> | ||
| ``` | ||
|
|
||
| 3. In the same folder, create a new `dockerfile` file and add the following code to it: | ||
|
|
||
| ```dockerfile | ||
| FROM nginx:alpine | ||
| COPY ./my-static-website /usr/share/nginx/html | ||
| EXPOSE 80 | ||
| ``` | ||
|
|
||
| 4. Run the command below to build, tag, and push your image to the Scaleway Container registry: | ||
|
|
||
| ```bash | ||
| docker build \ | ||
| --platform linux/amd64 \ | ||
| --push \ | ||
| -t <CONTAINER_REGISTRY_ENDPOINT>/my-static-website:latest . | ||
| ``` | ||
|
|
||
| <Message type="note"> | ||
| You can find your Container Registry endpoint in the **Settings** tab of your Container Registry Endpoint in the [Scaleway console](https://console.scaleway.com/registry/namespaces) | ||
| </Message> | ||
|
|
||
| 5. [Deploy a Serverless Container](/serverless-containers/how-to/deploy-container/) with the following parameters: | ||
|
|
||
| - **Registry**: Scaleway Container Registry | ||
| - **Registry namespace**: the Container Registry namespace you pushed your image to. | ||
| - **Container port**: `8O` as it is the [port](/serverless-containers/reference-content/port-parameter-variable/) exposed in the dockerfile. | ||
| - **Resources**: `100 mVCPU` and `256 MB` memory | ||
| - **Autoscaling**: set a minimum scale of `1` to avoid [cold starts](/serverless-containers/concepts/#cold-start) (optional). | ||
|
|
||
| The deployment of your container can take up to a minute to complete. | ||
|
|
||
| 6. Once your container is **ready**, click the **container endpoint** from its **Overview** tab. Your web page displays, and is available to anyone with the link. | ||
|
|
||
| ## Going further | ||
|
|
||
| - You can host a website composed of multiple pages in the `my-static-website` folder. | ||
| - You can [add a custom domain](/serverless-containers/how-to/add-a-custom-domain-to-a-container/) name to your website. | ||
| - You can host dynamic websites using dedicated frameworks for high-quality web applications. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| --- | ||
| title: Hosting a web app with Serverless Containers | ||
| description: This page provides guidelines on how to host and deploy dynamic web applications using Scaleway Serverless Containers | ||
| tags: deploy host website webapp react next containerize application docker dockerfile | ||
| products: | ||
| - containers | ||
| - container-registry | ||
| dates: | ||
| validation: 2025-10-06 | ||
| posted: 2025-10-06 | ||
| validation_frequency: 12 | ||
| difficulty: beginner | ||
| usecase: | ||
| - application-hosting | ||
| - deploy-external-software | ||
| - website-hosting | ||
| ecosystem: | ||
| - third-party | ||
| --- | ||
|
|
||
| import Requirements from '@macros/iam/requirements.mdx' | ||
|
|
||
|
|
||
| <Requirements /> | ||
|
|
||
| - A Scaleway account logged into the [console](https://console.scaleway.com) | ||
| - [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization | ||
| - Installed [Docker](https://docs.docker.com/get-started/get-docker/) or [Docker Egine](https://docs.docker.com/engine/install/) | ||
| - [Created a Scaleway Container Registry namespace](/container-registry/how-to/create-namespace/) and [logged into it](/container-registry/how-to/connect-docker-cli/) | ||
|
|
||
| ## Create and host a simple HTML static page | ||
|
|
||
| To host a static HTML page on Serverless Containers, you first need to create a simple HTML page that will serve as your website. Next, you will write a Dockerfile to containerize your application, specifying how your HTML file should be served. You will then build the container image locally, and push it to the [Scaleway Container Registry](/container-registry/), before deploying it to [Scaleway Serverless Containers](/serverless-containers/). | ||
|
|
||
| 1. In a terminal, run the command below to create a new folder and access it: | ||
|
|
||
| ```bash | ||
| mkdir my-static-website | ||
| cd my-static-website | ||
| ``` | ||
|
|
||
| 2. | ||
|
|
||
|
|
||
|
|
||
| 3. In the same folder, create a new `dockerfile` file and add the following code to it: | ||
|
|
||
| ```dockerfile | ||
| ``` | ||
|
|
||
| 4. Run the command below to build, tag, and push your image to the Scaleway Container registry: | ||
|
|
||
| ```bash | ||
| docker build \ | ||
| --platform linux/amd64 \ | ||
| --push \ | ||
| -t <CONTAINER_REGISTRY_ENDPOINT>/my-static-website:latest . | ||
| ``` | ||
|
|
||
| <Message type="note"> | ||
| You can find your Container Registry endpoint in the **Settings** tab of your Container Registry Endpoint in the [Scaleway console](https://console.scaleway.com/registry/namespaces) | ||
| </Message> | ||
|
|
||
| 5. [Deploy a Serverless Container](/serverless-containers/how-to/deploy-container/) with the following parameters: | ||
|
|
||
| - **Registry**: Scaleway Container Registry | ||
| - **Registry namespace**: the Container Registry namespace you pushed your image to. | ||
| - **Container port**: `8O` as it is the [port](/serverless-containers/reference-content/port-parameter-variable/) exposed in the dockerfile. | ||
| - **Resources**: `100 mVCPU` and `256 MB` memory | ||
| - **Autoscaling**: set a minimum scale of `1` to avoid [cold starts](/serverless-containers/concepts/#cold-start) (optional). | ||
|
|
||
| The deployment of your container can take up to a minute to complete. | ||
|
|
||
| 6. Once your container is **ready**, click the **container endpoint** from its **Overview** tab. Your web page displays, and is available to anyone with the link. | ||
|
|
||
| ## Going further | ||
|
|
||
| - You can host a website composed of multiple pages in the `my-static-website` folder. | ||
| - You can [add a custom domain](/serverless-containers/how-to/add-a-custom-domain-to-a-container/) name to your website. | ||
| - You can host dynamic websites using dedicated frameworks for high-quality web applications. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.