Answer the question
In order to leave comments, you need to log in
How to create a Dockerfile for web development (PHP/MySQL need an example)?
I used to raise a VDS server (I am familiar with the commands), but now everything is done in the docker.
I'm learning docker. According to the examples, everything works, but a step to the left, a step to the right are already problems.
Here is an example of my Dockerfile. My task is to install a LAMP "server".
You need to install everything in one container (without linking containers - often mysql is put in a separate container, but I need everything in one).
error 100 occurs at RUN --name some-mysql step. Wrong command syntax?
I took the command from docker hub. It most likely doesn't install anything though (it doesn't have apt-get -y install either).
FROM debian
RUN apt-get update
RUN apt-get -y install nano
RUN apt-get -y install nginx
RUN apt-get -y install mysql-server
RUN apt-get -y install php-fpm php-mysql php7.2-curl php7.2-mcrypt php7.2-mbstring
RUN apt-get -y install vsftpd
RUN --name some-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=mysecretpass -d mysql
EXPOSE 80
Answer the question
In order to leave comments, you need to log in
You need to install everything in one containeryou don’t have to continue, go read the basics about docker, because one service is one container. Info is easily googled, there are plenty of examples, and you can even just go to popular projects on github, and see how they do
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question