xJuliusCaesar
New member
Hallo Leute,
ich habe ein kleines Problem mit dem Composer-Container. Irgendwie will der bei mir nicht so wie ich.
Hier mal meine yml-Datei:
und die composer.json:
Prinzipiell startet der Container, aber er wird direkt wieder beendet.
Hier noch das Container-Log:
Ich hab das Internet durchforstet, aber ich finde nichts.
Ich habe, zu Testzwecken und wie man an den Dateien sieht, einen nginx-Webserver auf Port 82 und einen Apache auf Port 80 laufen. Der Composer sollte nach Möglichkeit so installiert sein, dass er als separater Container für beide Webserver zur Verfügung steht.
Zur Vollständigkeit noch das Dockerfile des nginx-Servers:
Die Verzeichnisstruktur sieht wie folgt aus:
Würde mich sehr freuen, wenn mir einer helfen könnte.
Beste Grüße
Nic
ich habe ein kleines Problem mit dem Composer-Container. Irgendwie will der bei mir nicht so wie ich.
Hier mal meine yml-Datei:
YAML:
---
name: devserver
networks:
devnetwork:
driver: bridge
name: devnetwork
services:
apache:
container_name: apache
depends_on:
- mariadb
image: php:apache
networks:
- devnetwork
ports:
- '80:80'
- '443:443'
restart: always
volumes:
- ./www:/var/www/html
- ./configs/php.ini:/usr/local/etc/php/php.ini
composer:
container_name: composer
image: composer:latest
networks:
- devnetwork
volumes:
- ./www:/var/www
- ~/.composer:/var/www/.composer
working_dir: /var/www
mariadb:
container_name: mariadb
environment:
- MYSQL_ROOT_PASSWORD=Topmsecret-0815
- MYSQL_DATABASE=testdb
- MYSQL_USER=xjuliuscaesar
- MYSQL_PASSWORD=Topmsecret-1307
image: mariadb:latest
networks:
- devnetwork
restart: always
volumes:
- ./database:/var/lib/mysql
nginx:
container_name: nginx
depends_on:
- mariadb
- apache
image: nginx:alpine
networks:
- devnetwork
ports:
- '82:80'
- '442:443'
restart: always
volumes:
- ./www:/var/www
- ./configs/nginx/:/etc/nginx/conf.d
- ./logs/nginx:/var/log/nginx
php-fpm:
build:
context: ./
dockerfile: nginxDockerfile
container_name: php-fpm
depends_on:
- mariadb
- apache
- nginx
- composer
networks:
- devnetwork
restart: always
volumes:
- ./www:/var/www
working_dir: /var/www/
phpmyadmin:
container_name: phpmyadmin
depends_on:
- mariadb
- apache
- nginx
environment:
- PMA_ARBITRARY=1
- PMA_HOST=mariadb
image: phpmyadmin:latest
networks:
- devnetwork
ports:
- '81:80'
restart: always
volumes:
- ./configs/php.ini:/usr/local/etc/php/php.ini
version: '3.8'
und die composer.json:
JSON:
{
"name": "php/lernen",
"description": "Dies ist ein Projekt zum Erlernen der Programmiersprache PHP.",
"type": "project",
"require": {
"monolog/monolog": "^2.0"
}
}
Prinzipiell startet der Container, aber er wird direkt wieder beendet.
Hier noch das Container-Log:
Code:
2024-04-17 15:10:53 ______
2024-04-17 15:10:53 / ____/___ ____ ___ ____ ____ ________ _____
2024-04-17 15:10:53 / / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
2024-04-17 15:10:53 / /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
2024-04-17 15:10:53 \____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
2024-04-17 15:10:53 /_/
2024-04-17 15:10:53 Composer version 2.7.2 2024-03-11 17:12:18
2024-04-17 15:10:53
2024-04-17 15:10:53 Usage:
2024-04-17 15:10:53 command [options] [arguments]
2024-04-17 15:10:53
2024-04-17 15:10:53 Options:
2024-04-17 15:10:53 -h, --help Display help for the given command. When no command is given display help for the list command
2024-04-17 15:10:53 -q, --quiet Do not output any message
2024-04-17 15:10:53 -V, --version Display this application version
2024-04-17 15:10:53 --ansi|--no-ansi Force (or disable --no-ansi) ANSI output
2024-04-17 15:10:53 -n, --no-interaction Do not ask any interactive question
2024-04-17 15:10:53 --profile Display timing and memory usage information
2024-04-17 15:10:53 --no-plugins Whether to disable plugins.
2024-04-17 15:10:53 --no-scripts Skips the execution of all scripts defined in composer.json file.
2024-04-17 15:10:53 -d, --working-dir=WORKING-DIR If specified, use the given directory as working directory.
2024-04-17 15:10:53 --no-cache Prevent use of the cache
2024-04-17 15:10:53 -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
2024-04-17 15:10:53
2024-04-17 15:10:53 Available commands:
2024-04-17 15:10:53 about Shows a short information about Composer
2024-04-17 15:10:53 archive Creates an archive of this composer package
2024-04-17 15:10:53 audit Checks for security vulnerability advisories for installed packages
2024-04-17 15:10:53 browse [home] Opens the package's repository URL or homepage in your browser
2024-04-17 15:10:53 bump Increases the lower limit of your composer.json requirements to the currently installed versions
2024-04-17 15:10:53 check-platform-reqs Check that platform requirements are satisfied
2024-04-17 15:10:53 clear-cache [clearcache|cc] Clears composer's internal package cache
2024-04-17 15:10:53 completion Dump the shell completion script
2024-04-17 15:10:53 config Sets config options
2024-04-17 15:10:53 create-project Creates new project from a package into given directory
2024-04-17 15:10:53 depends [why] Shows which packages cause the given package to be installed
2024-04-17 15:10:53 diagnose Diagnoses the system to identify common errors
2024-04-17 15:10:53 dump-autoload [dumpautoload] Dumps the autoloader
2024-04-17 15:10:53 exec Executes a vendored binary/script
2024-04-17 15:10:53 fund Discover how to help fund the maintenance of your dependencies
2024-04-17 15:10:53 global Allows running commands in the global composer dir ($COMPOSER_HOME)
2024-04-17 15:10:53 help Display help for a command
2024-04-17 15:10:53 init Creates a basic composer.json file in current directory
2024-04-17 15:10:53 install [i] Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json
2024-04-17 15:10:53 licenses Shows information about licenses of dependencies
2024-04-17 15:10:53 list List commands
2024-04-17 15:10:53 outdated Shows a list of installed packages that have updates available, including their latest version
2024-04-17 15:10:53 prohibits [why-not] Shows which packages prevent the given package from being installed
2024-04-17 15:10:53 reinstall Uninstalls and reinstalls the given package names
2024-04-17 15:10:53 remove [rm] Removes a package from the require or require-dev
2024-04-17 15:10:53 require [r] Adds required packages to your composer.json and installs them
2024-04-17 15:10:53 run-script [run] Runs the scripts defined in composer.json
2024-04-17 15:10:53 search Searches for packages
2024-04-17 15:10:53 self-update [selfupdate] Updates composer.phar to the latest version
2024-04-17 15:10:53 show [info] Shows information about packages
2024-04-17 15:10:53 status Shows a list of locally modified packages
2024-04-17 15:10:53 suggests Shows package suggestions
2024-04-17 15:10:53 update [u|upgrade] Updates your dependencies to the latest version according to composer.json, and updates the composer.lock file
2024-04-17 15:10:53 validate Validates a composer.json and composer.lock
Ich hab das Internet durchforstet, aber ich finde nichts.
Ich habe, zu Testzwecken und wie man an den Dateien sieht, einen nginx-Webserver auf Port 82 und einen Apache auf Port 80 laufen. Der Composer sollte nach Möglichkeit so installiert sein, dass er als separater Container für beide Webserver zur Verfügung steht.
Zur Vollständigkeit noch das Dockerfile des nginx-Servers:
Code:
FROM php:fpm
RUN apt-get update && apt-get install -y \
git \
curl \
zip \
unzip
WORKDIR /var/www
Die Verzeichnisstruktur sieht wie folgt aus:
Code:
Docker
|-> backups
|-> configs
|-> apache
> httpd.conf
|-> nginx
> nginx.conf
> php.ini
|-> databases
|-> logs
|-> nginx
> access-Earth.log
> access.log
> error.log
|-> www
|-> .composer
> composer.json
> meinWebserver.yml
> nginxDockerfile
Würde mich sehr freuen, wenn mir einer helfen könnte.
Beste Grüße
Nic