Home > Networking Solutions > Enterprise/Data Center Networking Solutions > Enterprise SONiC Networking Solutions > Guides > Zero Touch Deployment of Open Dell Switches with SONiC > Docker-compose configfile setup
To smoothly create and destroy the containers for the webserver and the DHCP server, a docker-compose.yml file is required. Create this file in your preferred location. For example, you could use your /home folder. In this case, we have placed the file in /home/ztd/ztdserver/.
version: '3'
services:
ztd-httpd:
restart: always
image: "enonicio/apache2"
ports:
- "80:80"
- "443:443"
volumes:
- /etc/dhcp:/etc/dhcp
- /tftpboot:/var/www/html
ztd-dhcpd:
restart: always
image: rackhd/isc-dhcp-server
volumes:
- /var/lib/dhcp:/var/lib/dhcp
- /etc/dhcp:/etc/dhcp
network_mode: "host"
The command used to start services (from where docker-compose.yml file resides):
cd /home/ztd/ztdserver/ && docker-compose up &
The command used to stop services (from where docker-compose.yml file resides):
cd /home/ztd/ztdserver/ && docker-compose down &
Note: Use spaces instead of tabs when you create a YAML file; otherwise, you will get errors when the file is used by docker-compose.
Always start the services from within the location where the docker-compose.yml file resides.
The first time you start docker-compose, the images are pulled from dockerhub. Subsequent starts will use a local copy of the image to create a container.