Answer the question
In order to leave comments, you need to log in
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/
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question