Aptible PaaS logoDocs

Defining Services

There are two ways to provide Aptible with the list of Services for your App:

Implicit Service (CMD)

If your App's Image includes a CMD and/or ENTRYPOINT declaration, a single implicit cmd service will be created for it when you deploy your App.

Containers for the implicit cmd Service will execute the CMD your image defines (if you have an ENTRYPOINT defined, then the CMD will be passed as arguments to the ENTRYPOINT).

This corresponds to Docker's behavior when you use docker run, so if you've started Containers for your image locally using docker run my-image, you can expect Containers started on Aptible to behave identically.

Typically, the CMD declaration is something you'd add in your Dockerfile, like so:

FROM alpine:3.5
ADD . /app
CMD ["/app/run"]
📘 Using an implicit service is recommended if your App only has one Service.

Explicit Services (Procfiles)

❗️ As you'd expect, no Implicit Service will be created for your App when you use Explicit Services.

If your App needs multiple Services, you can provide Aptible with a Procfile that indicates which services should be started when your App is deployed.

Broadly speaking, the Procfile contains a list of declarations, mapping service names to the commands the Containers for this service should run:

web: /app/run-web
worker: /app/run-worker

When your App Containers start, they'll execute the command defined in your Procfile. Each Service will run its associated command.

To learn more about Procfiles, see: Procfiles. In particular, review Procfile Commands to understand how the commands you list in your Procfile will be executed.