Skip to content

Commit ca74ee7

Browse files
committed
Move more stuff to docs/
1 parent 112dfd4 commit ca74ee7

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

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)