LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Containers (https://www.linuxquestions.org/questions/linux-containers-122/)
-   -   Docker compose (https://www.linuxquestions.org/questions/linux-containers-122/docker-compose-4175734900/)

Jason.nix 03-14-2024 06:49 AM

Docker compose
 
Hello,
I have some questions about the docker compose:

1- In an internet article, a file called docker-compose.yaml was created to build the container. Can I create a YAML file for each container and use docker compose up -d to run it? If this is possible, how can I specify the input file?

2- I want to start a website that uses Nginx web server and PHP and JavaScript programming languages. Do I need a container for each (Nginx, PHP and JavaScript)?

3- The following configuration file creates a container using image and connects the containers using links:
Code:

version: '3.9'
services:
  web:
    image: nginx:latest
    ports:
      - '80:80'
    volumes:
      - ./src:/var/www/html/index.html
    links:
      - php-fpm
  php-fpm:
    image: php:8-fpm

Right?

4- I have created a container and now I want to make some changes in the YAML file and apply these new changes to the container. What should I do?

5- Is there a special folder for making containers? For example, the /var/www directory is for the web server.

Thank you.

pan64 03-14-2024 07:03 AM

duplicate of https://www.linuxquestions.org/quest...on-4175734855/


All times are GMT -5. The time now is 03:21 AM.