Dockerfile Deploy Example

If you don't have an app to deploy but would like to try out Dockerfile Deploy, here's an example.

Create an App

First, create a new app on Aptible.

Note the Git Remote that is provided. Going forward in this article, we'll refer to it as $GIT_URL.

Initialize a local git repository

Next, create a new empty git repository on your local workstation:

git init test-dockerfile-deploy
cd test-dockerfile-deploy

Then, add a new Dockerfile in the root of the repository, with the following contents:

# Declare a base image:
FROM httpd:alpine

# Tell Aptible this app will be accessible over port 80:

# Tell Aptible to run "httpd -f" to start this app:
CMD ["httpd", "-f"]


Finally, deploy to Aptible:

# Commit the Dockerfile
git add Dockerfile
git commit -m "Add a Dockerfile"

# This URL is available in the Aptible Dashboard under "Git Remote".
# You got it after creating your app.
git remote add aptible "$GIT_URL"

# Push to Aptible
git push aptible master

This will deploy a basic image based on Alpine Linux running a HTTP server.