From 9275a666465c176fae317ff15bd620f5165668f0 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Fri, 4 Aug 2023 10:55:55 +0800 Subject: [PATCH] update CONTRIBUTING.md with a requirement for Docker Compose `name` property (#235) --- Apps/Mongo/docker-compose.yml | 2 +- CONTRIBUTING.md | 91 +++++++++++++++++------------------ 2 files changed, 46 insertions(+), 47 deletions(-) diff --git a/Apps/Mongo/docker-compose.yml b/Apps/Mongo/docker-compose.yml index 89497f3..ff9e775 100644 --- a/Apps/Mongo/docker-compose.yml +++ b/Apps/Mongo/docker-compose.yml @@ -1,4 +1,4 @@ -name: MongoDB +name: mongodb services: mongo: image: mongo:6.0.6 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cd659e5..527fdf8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ This document describes how to contribute an app to CasaOS AppStore. -## Submit Process +## Submit Process App submission should be done via Pull Request. Fork this repository and prepare the app per guidelines below. @@ -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`. @@ -132,59 +134,56 @@ Each directory under [Apps](Apps) correspond to a CasaOS App. The directory shou ``` 3. Magic Value - + **Note**: The features is only working in casaos 0.4.4 and newer version. For resolves some cases. Casaos provide some magic value to power your application: - - - Any environment variable that user to set - - $WEBUI_PORT - ##### Environment variable - > for developer + - Environment variable - 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 - > for application maintainer + - `WEBUI_PORT` - 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} - ``` - or - ```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. + ```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} + ``` + + **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