About the configuration file of laradocker

applications:

  image: tianon/true

nginx:

  build:
    context: ./nginx
    args:
      - PHP_UPSTREAM_CONTAINER=${NGINX_PHP_UPSTREAM_CONTAINER}
      - PHP_UPSTREAM_PORT=${NGINX_PHP_UPSTREAM_PORT}
  volumes_from:
    - applications
  volumes:
    - ${NGINX_HOST_LOG_PATH}:/var/log/nginx
    - ${NGINX_SITES_PATH}:/etc/nginx/sites-available
  ports:
    - "${NGINX_HOST_HTTP_PORT}:80"
    - "${NGINX_HOST_HTTPS_PORT}:443"
  depends_on:
    - php-fpm
  networks:
    - frontend
    - backend

as above, nginx has a volumes_from:- applications
which is equivalent to nginx container accessing Volume
of application container, but application container does not write volume,.

Feb.28,2021
Menu