This guide provides a template for deploying Atomia DNS using Docker Compose with Ansible automation.
No public Docker image is available for Atomia DNS. You must build a custom Docker image from the source code at https://github.com/atomia/atomiadns. This guide provides a template structure for organizations that have built their own images.
- name: Deploy Atomia DNS with Docker (Template)
hosts: atomia_dns_docker
become: true
vars:
atomia_dns_project_dir: /opt/atomia-dns
atomia_dns_image: "atomia-dns:latest" # Build from source
tasks:
- name: Install Docker
ansible.builtin.package:
name:
- docker
- docker-compose
state: present
- name: Create Atomia DNS project directory
ansible.builtin.file:
path: "{{ atomia_dns_project_dir }}"
state: directory
mode: "0755"
- name: Deploy docker-compose.yml template
ansible.builtin.copy:
dest: "{{ atomia_dns_project_dir }}/docker-compose.yml"
mode: "0644"
content: |
version: '3.8'
services:
atomia-dns:
image: {{ atomia_dns_image }}
ports:
- "8080:8080"
volumes:
- ./config:/etc/atomia-dns
mysql:
image: mysql:8.0
environment:
- MYSQL_ROOT_PASSWORD=change_me
- MYSQL_DATABASE=atomia_dns
volumes:
- mysql-data:/var/lib/mysql
volumes:
mysql-data:
Clone the Atomia DNS source and build a Docker image:
git clone https://github.com/atomia/atomiadns.git
cd atomiadns
# Create a Dockerfile based on your requirements
docker build -t atomia-dns:latest .