C
C
ChernovGV2019-10-17 06:37:54
Docker
ChernovGV, 2019-10-17 06:37:54

How to run docker with a big project?

Good morning!
Situation
1) have docker-compose

php-fpm:
    image: php:7.2-fpm
    env_file: .env
    volumes:
      <b>- ./:/var/www</b>

2) In the project directory (./frontend/web/img/products/) there are about 12 GB of images
Problem
On startup
docker-compose up -d --build

Gives an error message:
Building nginx
ERROR: Error processing tar file(exit status 1): write /frontend/web/img/products/81/some_image.jpg: no space left on device

Investigation
I check that there is space on the disk... Well, all right, I deleted all containers and images, rebooted the server, I started it - the same thing.
I run it again and look at the disk:
1)
:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 982M 0 982M 0% /dev
tmpfs 200M 7.7M 193M 4% /run
/dev/vda2 40G 21G 17G 56% /
...

2)
:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 982M 0 982M 0% /dev
tmpfs 200M 7.7M 193M 4% /run
/dev/vda2 40G 23G 15G 56% /
...

...
n)
:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 982M 0 982M 0% /dev
tmpfs 200M 7.7M 193M 4% /run
/dev/vda2 40G 38G 1G 56% / ...

In general, it can be seen that during the launch process, the place disappears somewhere.
But what to do with it, I have no idea. Tell me what am I doing wrong?
UPDATE:
The error occurs when using dockerfile and context:
php-fpm:
# image: php:7.2-fpm
build:
context: ./
dockerfile: docker/php.docker


Building php-fpm
ERROR: Error processing tar file(exit status 1): write /frontend/web/img/products/8/some_image.jpg: no space left on device

And even if you leave only in docker/php.docker:

FROM php:7.2-fpm
WORKDIR /var/www

I apologize for the original error in the question from nginx, I'm just dancing with a tambourine and there was a config out of sync and an error

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
ChernovGV, 2019-10-17
@ChernovGV

Yes, it's a matter of context. It turns out that it archives the entire project, including 15GB of images.
To exclude images from this process, you need to use dockerignore

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question