Hi all,
I’m new to Docker, and made a setup with docker-compose, however i’m coming from Vagrant and I used to install everything with Ansible (think mysql, and set all the custom configs).
If I want to do the same with docker compose, do i need to install Ansible/python etc in every seperate docker image and then make a script that instructs the seperate docker images with the ansible playbooks, or do i need to convert all the ansible commands into the equivalent dockerfiles during the docker-compose setup?
Example docker-compose
version: '3'
services:
web:
build:
context: .
dockerfile: Common.Dockerfile
container_name: nginxsite
restart: unless-stopped
tty: true
volumes:
- ./:/var/www
ports:
- "8080:80"
- "443:443"
networks:
- app-network
php:
build:
context: .
dockerfile: PHP.Dockerfile
ports:
- "9000:9000"
volumes:
- ./:/var/www
working_dir: /var/www
networks:
- app-network
mysql:
image: mysql:8.0.19
command: mysqld --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: 'root'
MYSQL_DATABASE: 'mytestdb'
volumes:
- ./docker-files/db-files:/docker-entrypoint-initdb.d
- ./dbdata:/var/lib/mysql
ports:
- 3306:3306
networks:
- app-network
rabbitmq:
image: rabbitmq:3.8.2-management-alpine
container_name: rabbitmq
environment:
RABBITMQ_DEFAULT_USER: defaultuser
RABBITMQ_DEFAULT_PASS: defaultuser
RABBITMQ_DEFAULT_VHOST: defaultuser
ports:
- 5672:5672
- 15672:15672
networks:
- app-network
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.10.2
container_name: elasticsearch
ports:
- 9200:9200
- 9300:9300
environment:
ES_JAVA_OPTS: '-Xms256m -Xmx256m'
network.bind_host: 0.0.0.0
network.host: 0.0.0.0
discovery.type: single-node
networks:
- app-network
redis:
image: "redis:5.0.7-alpine"
container_name: redis
networks:
- app-network
networks:
app-network:
driver: bridge
thanks in advance!