This Ansible role is used for deploying your Docker application on a Debian server
- SSH access to the server
- Git repository with project
- Docker Compose file
If you want to use a differently named docker-compose file, you can change that. The default is docker-compose.yml
docker-compose_name: docker-compose.yml
Give the url of the git repo from which needs to be pulled.
repository_url: git@github.com:skrepr/ansible-role-deploy.git
Give the directory where the application needs te be installed on the server. The default is /home/deploy/project
project_directory: /home/deploy/project
Choose the branch you want to use for pulling
git_branch: main
Choose the port where the docker nginx container will be running. If you're not using nginx or a webserver in the container environment, you can disable it all together.
nginx_config: true
nginx_port_container: 8080
None.
#!/usr/bin/env ansible-playbook
- hosts: production
become: true
become_flags: "--preserve-env=SSH_AUTH_SOCK"
roles:
- geerlingguy.git
- geerlingguy.pip
- geerlingguy.docker
- geerlingguy.nginx
- skrepr.deploy
MIT / BSD
This role was created in 2021 by Jeroen van der Meulen, commisioned by Skrepr