update CONTRIBUTING.md with a requirement for Docker Compose `name` property (#235)
This commit is contained in:
parent
9a7e09b023
commit
9275a66646
|
@ -1,4 +1,4 @@
|
|||
name: MongoDB
|
||||
name: mongodb
|
||||
services:
|
||||
mongo:
|
||||
image: mongo:6.0.6
|
||||
|
|
|
@ -39,7 +39,9 @@ App-Name
|
|||
|
||||
Each directory under [Apps](Apps) correspond to a CasaOS App. The directory should contain at least a `docker-compose.yml` file:
|
||||
|
||||
- It should be a valid [Docker Compose file](https://docs.docker.com/compose/compose-file/).
|
||||
- It should be a valid [Docker Compose file](https://docs.docker.com/compose/compose-file/). Here are some requirements (but not limited to):
|
||||
|
||||
- `name` must contain only lower case letters, numbers, underscore "`_`" and hyphen "`-`" (in other words, must match `^[a-z0-9][a-z0-9_-]*$`)
|
||||
|
||||
- Image tag should be specific, e.g. `:0.1.2`, instead of `:latest`.
|
||||
|
||||
|
@ -137,54 +139,51 @@ Each directory under [Apps](Apps) correspond to a CasaOS App. The directory shou
|
|||
|
||||
For resolves some cases. Casaos provide some magic value to power your application:
|
||||
|
||||
- Any environment variable that user to set
|
||||
- $WEBUI_PORT
|
||||
- Environment variable
|
||||
|
||||
##### Environment variable
|
||||
> for developer
|
||||
your application can read environment variable that user set, such as `OPENAI_API_KEY` from environment variable. It is store in `/etc/casaos/env`. User can set only once and using anywhere. It can be change by api, after change, all application will re up to inject new env var.
|
||||
|
||||
your application can read environment variable that user set, such as `OPENAI_API_KEY` from environment variable. It is store in `/etc/casaos/env`. User can set only once and using anywhere. It can be change by api, after change, all application will re up to inject new env var.
|
||||
**Note**: change the config didn't change the env var of current container. To set env var, you should use cli to set it.
|
||||
|
||||
**Note**: change the config didn't change the env var of current container. To set env var, you should use cli to set it.
|
||||
- `WEBUI_PORT`
|
||||
|
||||
#### WEBUI_PORT
|
||||
> for application maintainer
|
||||
your `docker-compose.yml` can use `WEBUI_PORT` to set webui port. Casaos will assign a available port for your application. You can use it like this:
|
||||
|
||||
your `docker-compose.yml` can use `WEBUI_PORT` to set webui port. Casaos will assign a available port for your application. You can use it like this:
|
||||
```yaml
|
||||
...
|
||||
ports:
|
||||
- target: 5230
|
||||
published: ${WEBUI_PORT}
|
||||
protocol: tcp
|
||||
...
|
||||
x-casaos:
|
||||
architectures:
|
||||
- amd64
|
||||
- arm64
|
||||
- arm
|
||||
...
|
||||
port_map: ${WEBUI_PORT}
|
||||
```
|
||||
|
||||
```yaml
|
||||
...
|
||||
ports:
|
||||
- target: 5230
|
||||
published: ${WEBUI_PORT}
|
||||
protocol: tcp
|
||||
...
|
||||
x-casaos:
|
||||
architectures:
|
||||
- amd64
|
||||
- arm64
|
||||
- arm
|
||||
...
|
||||
port_map: ${WEBUI_PORT}
|
||||
```
|
||||
or
|
||||
```yaml
|
||||
...
|
||||
ports:
|
||||
- target: 5230
|
||||
published: ${WEBUI_PORT:-5230}
|
||||
protocol: tcp
|
||||
...
|
||||
x-casaos:
|
||||
architectures:
|
||||
- amd64
|
||||
- arm64
|
||||
- arm
|
||||
...
|
||||
port_map: ${WEBUI_PORT:-5230}
|
||||
```
|
||||
or
|
||||
|
||||
**Note**: the WEBUI_PORT only allocated once. It promise the port is available when allocated. If the port be used by other application. It didn't reallocate a new port.
|
||||
```yaml
|
||||
...
|
||||
ports:
|
||||
- target: 5230
|
||||
published: ${WEBUI_PORT:-5230}
|
||||
protocol: tcp
|
||||
...
|
||||
x-casaos:
|
||||
architectures:
|
||||
- amd64
|
||||
- arm64
|
||||
- arm
|
||||
...
|
||||
port_map: ${WEBUI_PORT:-5230}
|
||||
```
|
||||
|
||||
**Note**: the WEBUI_PORT only allocated once. It promise the port is available when allocated. If the port be used by other application. It didn't reallocate a new port.
|
||||
|
||||
## Requirements for Featured Apps
|
||||
|
||||
|
|
Loading…
Reference in New Issue