Answer the question
In order to leave comments, you need to log in
How to correctly configure a shared resource between containers?
Colleagues, hello!
# Development configuration
version: "3.7"
services:
# Php application
app:
container_name: rapp.app
restart: on-failure
build:
context: .
dockerfile: ./docker/php/Dockerfile-dev
volumes:
- ./:/www/
- ./docker/php/log:/var/log
- ./docker/php/usr/local/etc/php/conf.d:/usr/local/etc/php/conf.d
- type: bind
source: ./images
target: /www/images
depends_on:
- db
links:
- db
expose:
- 9000
environment:
PHP_INI_SCAN_DIR: ":/usr/local/etc/php/conf.d"
TZ: "Europe/Moscow"
...
# Nginx api admin server
nginx-images:
container_name: rapp.nginx-images
restart: on-failure
image: nginx:latest
volumes:
- ./docker/nginx/dev/nginx.conf:/etc/nginx/nginx.conf
- ./docker/nginx/dev/sites-enabled/vhost-images.conf:/etc/nginx/sites-enabled/vhost-images.conf
- type: bind
source: ./images
read_only: true
target: /www/images
ports:
- 127.0.0.100:8013:80
depends_on:
- app
expose:
- 80
command: ["nginx", "-g", "daemon off;"]
Warning: unlink(/www/images/1/categories/385d87d3d566437ca99b1161e93d78db-5e406295b30e1.jpeg): Device or resource busy
Answer the question
In order to leave comments, you need to log in
From
Tom's documentation, benefits of using.
Igor, well, it's obvious that nginx is blocking the file. How exactly - I don't know, it depends on the file system and the operations that nginx performs. The same would have happened without docker if these services were neighbors on the same server.
-------------------------------------------------- -----------------------------
I would start with "open_file_cache off" in the nginx config
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question