Как развернуть docker nginx+php+mysql без compose?

Рейтинг: 1Ответов: 0Опубликовано: 09.08.2023

введите сюда описание изображенияХочу построить docker 3 в 1 :nginx+php+mysql без compose.При установке возникли 2 проблемы :

  1. слушается только 80 порт , а порты 9000 и 3306 -нет
  2. не знаю куда интегрировать index.php file,сейчас отображается только index.html

Мой Dockerfile:

FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
#Update packages & Install the nginx package
RUN apt-get update 
    && apt install -y nginx php php-fpm mysql-server 
    && apt clean
#Copy layout mysite.conf
COPY ./mysite.conf /etc/nginx/sites-enabled/default
#Setting the working directory /data All commands will continue to work from here
WORKDIR /data
#Create the /data directory that happened when the container was restarted
VOLUME /data
# Instruction - the application runs on port 80
EXPOSE 80
# The command to start nginx when starting the container
CMD [ "nginx" , "-g" , "daemon off;" , "php-fpm" , "mysql-server" ]

Ответы

Ответов пока нет.