I know about the laradock, but i need to pass all the steps for myself.
i gonna learn Laravel and the same time recently i have opened for myself docker :)
now i need to join alltogether:
docker-compose with images:
- php:7.2.2-apache
- mariadb
- phpmyadmin/phpmyadmin
- and some how composer
laravel will be on my host outside containers.
so far i have made my own image "web_server" from the php:7.2.2-apache image and run inside mod_rewrite
FROM php:7.2.2-apache
RUN apt update && apt install mc -y && apt install composer -y
RUN a2enmod rewrite
my docker-compose.yml looks like
version: '3'
services:
db:
image: mariadb
volumes:
- ./db:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: "secretpswd"
MYSQL_DATABASE: "test_db"
MYSQL_USER: "my_user"
MYSQL_PASSWORD: "secretpswd"
ports:
- "3306:3306"
web:
image: web_server
container_name: php_web
depends_on:
- db
volumes:
- ./www:/var/www/html/
ports:
- "80:80"
stdin_open: true
tty: true
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: pma
depends_on:
- web
- db
environment:
PMA_HOST: "db"
PMA_PORT: 3306
PMA_ARBITRARY: 1
restart: always
ports:
- 8080:80
volumes:
- ./sessions:/sessions
now i have to install composer ...
i have two choices
- use
composer/composerimage from the docker hub in this case i have no idea how it will be used by laravel and with laravel because laravel will be under the control of separatewebcontainer - install composer inside the
web_serverimage which is made from
thephp:7.2.2-apacheimage
i have tried but start receiving errors
The following packages have unmet dependencies:
composer : Depends: php-symfony-console (>= 2.5) but it is not installable
Depends: php-symfony-filesystem (>= 2.5) but it is not installable
Depends: php-symfony-finder (>= 2.4) but it is not installable
Depends: php-symfony-process (>= 2.4) but it is not installable
Depends: php-cli
Depends: php-common but it is not installable
Depends: php-json-schema but it is not installable
Depends: php-composer-ca-bundle (>= 1.0) but it is not installable
Depends: php-composer-ca-bundle (< 2~~) but it is not installable
Depends: php-composer-semver (>= 1.0) but it is not installable
Depends: php-composer-semver (< 2~~) but it is not installable
Depends: php-composer-spdx-licenses (>= 1.0) but it is not installable
Depends: php-composer-spdx-licenses (< 2~~) but it is not installable
Depends: jsonlint (>= 1.4) but it is not going to be installed
Depends: jsonlint (< 2~~) but it is not going to be installed
Depends: php-cli-prompt (>= 1.0) but it is not installable
Depends: php-cli-prompt (< 2~~) but it is not installable
Depends: php-psr-log (>= 1.0) but it is not installable
Depends: php-psr-log (< 2~~) but it is not installable
Recommends: git but it is not going to be installed E: Unable to correct problems, you have held broken packages. The command '/bin/sh -c apt update && apt install mc -y && apt install composer -y' returned a non-zero code: 100
so it's time to ask for help.
which way should i use?
in case of separate
composer/composercontainer how to use it inside web_server container and how laravel will use it- in case of the composer installation inside
php:7.2.2-apacheimage how to solve those errors