Skip to content

Commit 55d3619

Browse files
committed
Move more stuff to docs/
1 parent 827dee5 commit 55d3619

File tree

2 files changed

+47
-53
lines changed

2 files changed

+47
-53
lines changed

README.md

+5-53
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ If you are using [Scaleway IAM](/identity-and-access-management/iam/how-to/activ
2020
2. Create a function from this template:
2121

2222
```shell
23-
serverless create --path my-func --template-url https://github.com/scaleway/serverless-scaleway-functions/tree/master/examples/${TEMPLATE}
23+
serverless create --path ${TEMPLATE}-func --template-url https://github.com/scaleway/serverless-scaleway-functions/tree/master/examples/${TEMPLATE}
2424
```
2525

2626
3. Install dependencies:
2727

2828
```shell
29-
cd my-func
29+
cd ${TEMPLATE}-func
3030
npm i
3131
```
3232

@@ -50,8 +50,6 @@ Serverless Framework handles everything from creating namespaces to function/cod
5050
- [Configuration](#configuration)
5151
- [Supported commands](#supported-commands)
5252
- [Security and secret management](#security-and-secret-management)
53-
- [Events](#events)
54-
- [Custom domains](#custom-domains)
5553
- [Deployment methods](#deployment-methods)
5654
- [Local testing](#local-testing)
5755
- [Managing containers](#managing-containers)
@@ -215,15 +213,11 @@ custom:
215213
key-b: "value-b"
216214
```
217215
218-
### Deployment methods
216+
## Auto-deletion
219217
220-
At Scaleway, there are multiple ways to create Serverless Functions and Serverless Containers. These include: the CLI, APIs, the Scaleway console, Serverless Framework and Terraform.
218+
By default, the `serverless deploy` command applies the configuration located in your `serverless.yml` and removes functions in that namespace that are not in the file.
221219

222-
The `serverless deploy` command applies the configuration located in your `serverless.yml` and removes functions that are not in the file to ensure a single source of truth.
223-
224-
This can be controlled using the `singleSource` option. By default its value is `false`.
225-
226-
If `singleSource` is set to `true`, functions and containers not defined in your serverless configuration file will be removed the next time you run the `serverless deploy` command.
220+
This can be switched off by setting the `singleSource` option to `false`.
227221

228222
### Local testing
229223

@@ -234,48 +228,6 @@ Documentation is available through runtimes frameworks for :
234228
* [Python](https://github.com/scaleway/serverless-functions-python)
235229
* [Node](https://github.com/scaleway/serverless-functions-node)
236230

237-
### Managing containers
238-
239-
>**Requirements:**
240-
- You have [created a Container Registry namespace](https://www.scaleway.com/en/docs/compute/container-registry/how-to/create-namespace/)
241-
- You have installed Docker and can build and push your image to your registry.
242-
243-
To manage your containers, you must first define them in the `custom.containers` field in your `serverless.yml` configuration file.
244-
245-
Each container must specify the relative path of its application directory (containing the Dockerfile, and all files related to the application to deploy):
246-
247-
```yml
248-
custom:
249-
containers:
250-
mycontainer:
251-
directory: my-container-directory
252-
# port: 8080
253-
# Environment only available in this container
254-
env:
255-
MY_VARIABLE: "my-value"
256-
```
257-
258-
Below is an example of the files you should have in your application directory. The directory that contains your Dockerfile and scripts is called `my-container-directory`.
259-
260-
```
261-
.
262-
├── my-container-directory
263-
│   ├── Dockerfile
264-
│   ├── requirements.txt
265-
│ ├── server.py
266-
│   └── (...)
267-
├── node_modules
268-
│   ├── serverless-scaleway-functions
269-
│ └── (...)
270-
├── package-lock.json
271-
├── package.json
272-
└── serverless.yml
273-
```
274-
275-
Scaleway's platform will automatically inject a PORT environment variable on which your server should be listening for incoming traffic. By default, this PORT is 8080. You can change the `port` in the `serverless.yml` file.
276-
277-
You can use the container example provided on this [documentation page](https://github.com/scaleway/serverless-scaleway-functions/tree/master/examples/container) to get started.
278-
279231
## Logs
280232

281233
The `serverless logs` command lets you watch the logs of a specific function or container.

docs/containers.md

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Managing containers
2+
3+
>**Requirements:**
4+
- You have [created a Container Registry namespace](https://www.scaleway.com/en/docs/compute/container-registry/how-to/create-namespace/)
5+
- You have installed Docker and can build and push your image to your registry.
6+
7+
To manage your containers, you must first define them in the `custom.containers` field in your `serverless.yml` configuration file.
8+
9+
Each container must specify the relative path of its application directory (containing the Dockerfile, and all files related to the application to deploy):
10+
11+
```yml
12+
custom:
13+
containers:
14+
mycontainer:
15+
directory: my-container-directory
16+
# port: 8080
17+
# Environment only available in this container
18+
env:
19+
MY_VARIABLE: "my-value"
20+
```
21+
22+
Below is an example of the files you should have in your application directory. The directory that contains your Dockerfile and scripts is called `my-container-directory`.
23+
24+
```
25+
.
26+
├── my-container-directory
27+
│   ├── Dockerfile
28+
│   ├── requirements.txt
29+
│ ├── server.py
30+
│   └── (...)
31+
├── node_modules
32+
│   ├── serverless-scaleway-functions
33+
│ └── (...)
34+
├── package-lock.json
35+
├── package.json
36+
└── serverless.yml
37+
```
38+
39+
Scaleway's platform will automatically inject a PORT environment variable on which your server should be listening for incoming traffic. By default, this PORT is 8080. You can change the `port` in the `serverless.yml` file.
40+
41+
You can use the container example provided on this [documentation page](https://github.com/scaleway/serverless-scaleway-functions/tree/master/examples/container) to get started.
42+

0 commit comments

Comments
 (0)