Aptible PaaS logoDocs

Experiment with Dockerfile Deploy

Use this guide if you don't have an app to deploy but want to try out Dockerfile Deploy:

Step 1: Create a new App on Aptible. Note the provided Git Remote. As we advance in this article, we'll refer to it as $GIT_URL.

Step 2: Create a new empty git repository on your local workstation:

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

Step 3: 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:
EXPOSE 80

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

Step 4: 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

Congratulations! You have deployed a basic image based on Alpine Linux running an HTTP server.