How to deploy from Git
Guide for deploying from Git using Dockerfile Deploy
With Aptible, you have the option to deploy your code directly from Git using Dockerfile Deploy. This method involves pushing your source code, including a Dockerfile, to Aptible's Git repository. Aptible will then create a Docker image for you, simplifying the deployment process. This guide will walk you through the steps of using Dockerfile Deploy to deploy your code from Git to Aptible.
Deploying via the Dashboard
Deploying via the CLI
⚠️ Prerequisites: Install the Aptible CLI
Step 1: Create an app
Step 2: Create a git repository on your local workstation
git init test-dockerfile-deploy cd test-dockerfile-deploy
Step 3: Add your Dockerfile in the root of the repository
# 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
Deploying via Terraform
Dockerfile Deploy is not supported by Terraform. Use Direct Docker Image Deploy with Terraform instead.