First, have a look at this simple example. Now, read on for more details:
captainVersion: 4
to the very top of the yaml file.Add this section to the end of the yaml file:
caproverOneClickApp:
variables:
- id: '$$cap_myapp_version'
label: Awesome App Version
defaultValue: '1.2.3'
description: Check out their Docker page for the valid tags https://hub.docker.com/r/....../tags
validRegex: '/.{1,}/'
instructions:
start: |-
A description that will be displayed to the user when they
are installing one click app!
It can be multiline and contain more details and probably special
hardware requirements!
end: |-
A summary when the app is deployed!
It can be multiline.
It can also include the dynamic parameters such as
$$cap_appname and $$cap_other_random_char
displayName: The Awesome App
isOfficial: true ## Only if all images used here are official or from a trusted source.
description: A relatively short description, less than 200 characters.
documentation: This docker-compose is taken from example.com
$$cap
$$cap_appname
, $$cap_root_domain
, and $$cap_gen_random_hex(length)
. For example, if your app needs environment variables with the URL value of the app, you can use $$cap_appname.$$cap_root_domain
which resolves to something like myappname.rootdomain.com
. Also If you need a default password, you can use $$cap_gen_random_hex(10)
id
, label
. They could also have defaultValue
, validRegex
, description
.Even though, the format used by One Click apps is Docker Compose, not all parameters defined in Docker Compose file are parsed out by CapRover. Only the following parameters are used:
image
environment
ports
volumes
depends_on
hostname
command
cap_add
Other parameters are currently being ignored by CapRover. If you need a particular parameter, please file an issue, and we'll add it to the respected list.
Aside the the Docker Compose template, services have a special subsection specific to CapRover called caproverExtra
which contains service specific parameters that are only available via CapRover and not docker compose. Currently this field can take the following variables:
dockerfileLines
which is a multiline variable, and can be used instead of image
property in the service. You must delete the image
property if you want to use this parameter.containerHttpPort
is useful when the underlying service uses a custom port for HTTP. If not provided, the default will be "80"
notExposeAsWebApp
can be set to "true"
when the underlying service is not an HTTP app. This is useful for databases and other internally used services.websocketSupport
can be set to "true"
to automatically enable Websocket Support. Only supported in versions 1.12+After creating your One-Click app yaml file, you need to test it before creating a Pull Request. Here is how you test it:
You may want to build your own private repository. CapRover supports having multiple repositories. You can add new repository URLs to the one click app page. The official one, this one, is available as https://oneclickapps.caprover.com
.
To create your own repository:
npm i
npm run validate_apps
npm run formatter-write
npm run build
./dist
directory anywhere you want, the official repo uses github pages to publish the content. Make sure to update CNAME to your own URL if you decide to do so.Your own private repository can be hosted on a CapRover instance with the newly-added captain-definition file.
To set up your private repository on CapRover:
captain-definition
in your fork's root directorycaprover-apps
, leave the Has Persistent Data checkbox unchecked, and click Create New App..tar
) of the contents of the one-click-apps repo and uploading it under Method 2: Tarball.Welcome to nginx!
page.In order to add a third party repository:
https://Awes0meHub.github.io/caprover-one-click-apps
) and paste it in to the text box