I’m new to Docker and literally only a few hours into learning containers. I have a new job where I’m tasked to document the applications even though I have no experience with application development or coding. I’m trying to learn Docker containers etc so that I can help write the documents for developers.
I found my first project that would be perfect to learn after I ran through the docker tutorial successfully. I found a blog that is well written on how to create a lamp stack where Apache, PHP and MySQL run in separate containers in a persistent state. https://www.thearmchaircritic.org/tech-journals/creating-a-lamp-stack-using-docker-compose
I’m getting an error when starting the docker compose for each of the services as follows:
Unsupported config option for services: ‘mysql’
Unsupported config option for services: ‘php’
Unsupported config option for services: ‘mysql’
I have no idea what is causing the error and would appreciate the help
guess I can’t attach a file, hopefully after pasting my docker-compose.yml content, I will have to edit in order for indents to properly be displayed here.
services:
apache:
build: ‘./apache’
restart: always
ports:
- 80:80
- 443:443
networks:
- frontend
- backend
volumes:
- ./public_html:/usr/local/apache2/htdocs
- ./cert/:/usr/local/apache2/cert/
depends_on:
- php
- mysql
php:
build: ‘./php’
restart: always
networks:
- backend
volumes:
- ./public_html:/usr/local/apache2/htdocs
- ./tmp:/usr/local/tmp
mysql:
build: ‘./mysql’
restart: always
networks:
- backend
volumes:
- ./database:/var/lib/mysql
SORRY, the above content for docker-compose.yml is properly indented in the editor but the indents actually disappear in the forum. That said, I don’t believe its an indexing issue
Below is the content of the dockerfile
FROM httpd:2.4.35-alpine
RUN apk update;
apk upgrade;
COPY ./apache.conf /usr/local/apache2/conf/httpd.conf
EXPOSE 80
EXPOSE 443
FROM mysql:8.0.13
ENV MYSQL_ROOT_PASSWORD ## place holder for password was replaced ##
COPY my.cnf /etc/mysql/
FROM php:7.3-rc-fpm-alpine
RUN apk update;
apk upgrade;
RUN docker-php-ext-install mysqli
RUN apk add freetype libpng libjpeg-turbo freetype-dev libpng-dev libjpeg-turbo-dev
RUN docker-php-ext-install -j$(nproc) iconv
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
RUN docker-php-ext-install -j$(nproc) gd
COPY php.ini /usr/local/etc/php/php.ini