W
W
WhatYouDoing2019-03-12 21:02:28
Docker
WhatYouDoing, 2019-03-12 21:02:28

How is mapping implemented in docker?

There is such a docker-compose,

version: '3'
services:
    web:
        image: nginx
        volumes:
            - ./.docker/conf/nginx/default.conf:/etc/nginx/conf.d/default.conf
            - ${APP_PATH_HOST}:${APP_PATH_CONTAINER}
        working_dir: ${APP_PATH_CONTAINER}
        ports:
            - 80:80
        restart: always
        depends_on:
            - php
            - db
    php:
        image: php:latest
        build: .docker
        restart: always
        volumes:
            - ./.docker/conf/php/php.ini:/usr/local/etc/php/conf.d/php.ini
            - ./.docker/conf/php/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini
            - ${APP_PATH_HOST}:${APP_PATH_CONTAINER}
        environment:
          - DB_DATABASE=${DB_NAME}
          - DB_USERNAME=${DB_USER}
          - DB_PASSWORD=${DB_PASSWORD}
          - DB_PORT=${DB_PORT}
    composer:
        image: composer
        volumes:
            - .:/app
        command: install
    db:
        image: postgres:10.1
        restart: always
        environment:
            - POSTGRES_DB=${DB_NAME}
            - POSTGRES_USER=${DB_USER}
            - POSTGRES_PASSWORD=${DB_PASSWORD}
        ports:
            - ${DB_PORT}:${DB_PORT}
        volumes:
            - ./.docker/conf/postgres/:/docker-entrypoint-initdb.d/

the task is to implement mapping to the main folder in the php container, to the statics for nginx and for the database
, maybe someone has links to such information or how it simply looks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav Lyskov, 2019-03-12
@Vlatqa

https://docs.docker.com/compose/networking/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question