You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 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.
0 commit comments