1
what would be the best way to add PHP extensions such as the GD library and more directly into Docker-Compose.yml?
My file is as below:
nginx:
image: tutum/nginx
ports:
- "80:80"
links:
- phpfpm
volumes:
- ./nginx/default:/etc/nginx/sites-available/default
- ./nginx/default:/etc/nginx/sites-enabled/default
- ./logs/nginx-error.log:/var/log/nginx/error.log
- ./logs/nginx-access.log:/var/log/nginx/access.log
phpfpm:
image: php:fpm
ports:
- "9000:9000"
volumes:
- ./public:/usr/share/nginx/html
- ./custom.ini:/usr/local/etc/php/conf.d/custom.ini
mysql:
image: mariadb
environment:
MYSQL_DATABASE: lista
MYSQL_USER: root
MYSQL_PASSWORD: 123
MYSQL_ROOT_PASSWORD: 123
command: mysqld --innodb-buffer-pool-size=1024M
ports:
- "3306:3306"
If it’s any help, you can use an official image that already comes with the most common extensions from
php
,take a look therein. Or you can use these Dockerfiles as a basis to build your.– Tuxpilgrim
You can tell me how I would inform this image in my Docker-Compose?
– Victor M.
You build your own php image (based on the ones I mentioned) and then only reference in
image
, instead of calling the one you’re using. Ex: Dockerfile forphp 7.0-fpm
. Know how to build images with the Dockerfile?– Tuxpilgrim
I don’t know, I’m starting to work with Docker now, I’m gonna do some research on.
– Victor M.
Take a look at this article, and recommend the play-with-Docker to train in practice ;)
– Tuxpilgrim