This article describes the process of creating services in D2C. All definitions from creating (and editing) service page are described here. There are some definitions which should be explained.
You may also find helpful one-by-one instructions on creating different services in D2C.
What you need to know before creating¶
Service names should be unique across your account
Directories, which should not be deleted after rebuild or redeploy (user generated content, plugins, logs, etc.) should be specified as Volumes in Persistent Data volumes block. Check sync if you want to synchronize files between all containers of service. Do not use it for database files
All services in a project are visible for each other inside. Access from the internet is disabled by default (except NGINX and HAProxy). You can open access from the Internet in “Ports” block
Application should listen on 0.0.0.0:3000 (not 127.0.0.1:3000)
- NGINX, NGINX-Static, HAProxy has enabled access from the Internet by default on port 80
Parameters and definitions¶
|Name||Yes||The name should be unique across your account. More about Naming|
|Configuration||Yes||Check available configurations. Default is StandAlone|
|Version||Yes||You can specify any of supported versions here. Usually, it is the most stable one by default|
|Password/Root password||No||Root password. Required for some configurations, e.g. MongoDB ReplicaSet|
|Username||No||Create a user during deploying service (database). Database will be created with the same name|
|UserPassword||No||Password for a user of database|
|Preinstall||No||Additional software which you can want to install with your app|
|Extensions and Pecl packages||No||Additional modules for PHP-FPM and PHP-Apache services.|
|Global dependencies||No||Commands for installing global dependencies of your service.
Examples: pip install, bundle install, apt-get install, npm install -g
|Initial commands||No||Commands which are executed only once after deploying a service|
Only for Application services and services based on Docker
|Git/Repository URL||No||Example: https://github.com/d2cio/nodejs-hello-world|
|Git | branch\tag\commit||No||You can specify branch, tag or commit. Examples:
|Git/Auth method||No||Choices: SSH (recommended), Login/Password.
If you specify private repository and SSH, you should add an SSH key to your account (GitHub and BitBucket manuals)
|Git/Repository login||No||Login for base auth or for FTP server|
|Git/Repository password||No||Password for base auth or for FTP server|
|Download/URL||No||Protocols: http, https, ftp.
File formats: .tar.bz2, .tar.gz, .tar, .zip
|Download/Login||No||Login of FTP server|
|Download/Password||No||Password of FTP server|
|Upload||No||You can upload an archive from your computer.
Protocols: http, https, ftp.
File formats: .tar.bz2, .tar.gz, .tar, .zip
Maximum size: 50MB
|Local dependencies and code’s preparation||No||Commands for installing local dependencies and making your code ready to work.
Examples: npm install, composer install, bower install, etc. or do some for preparation:
Examples: gulp build, grunt build, etc.
|Start command||Yes||Start command is executing your application. The application should be in the foreground without daemonizing|
|Access from the Internet||Yes||All services in a project are visible for each other inside.
If you want your service to be visible from the Internet, you should enable this option and define ports.
Disabled by default for all services except NGINX and HAProxy
|Ports\Protocol||Yes||Choices: UDP or TCP|
|Ports\Port||Yes||Should be integer|
Persistent data volumes¶
|Add volume||No||Persistent data volumes - directories, which should not be deleted after rebuild or redeploy (user generated content, plugins, logs, etc.)|
|Sync||No||When you have more than one container you can need to sync data between volumes. Simply check the volumes which you want to sync|
|Add custom config||No||Some services have default config files (e.g. PHP-FPM, PHP-Apache, MongoDB). You can add your additional config files or edit/replace defaults.|
Only for NGINX, NGINX-Cluster and HAProxy. You can use automatically generated configs, edit them or use owns. Domains and certificates should be specified in this block.
|Protocol||Yes||HTTP||Choices: HTTP, HTTPS|
|Mode||Yes||Proxy||Choices: Proxy, uWSGI|
|Domains||No||Domains and subdomains for a service|
Select a host(s) you want an application to deploy to.