first code commit from mac; changed docker setup for new mac development environment
This commit is contained in:
parent
5882940435
commit
cfdd150ca0
3
.gitignore
vendored
3
.gitignore
vendored
@ -8,6 +8,9 @@ composer.phar
|
||||
# ignore .test folders
|
||||
.test
|
||||
|
||||
#ignore apple files
|
||||
.DS_Store
|
||||
|
||||
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
|
||||
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
|
||||
# composer.lock
|
||||
|
@ -18,9 +18,11 @@
|
||||
"require": {},
|
||||
"scripts": {
|
||||
"setup": "php public/index.php run:setup",
|
||||
"serve-dev": "podman-compose up -d --build --build-arg INSTALL_XDEBUG=true",
|
||||
"stop-serve-dev": "podman-compose down",
|
||||
"serve": "docker-compose up -d --build",
|
||||
"docker-dev-init": "docker-compose build --build-arg INSTALL_XDEBUG=true",
|
||||
"serve-dev": "docker-compose up -d",
|
||||
"stop-serve-dev": "docker-compose down",
|
||||
"docker-init": "docker-compose build --build-arg INSTALL_XDEBUG=false",
|
||||
"serve": "docker-compose up -d",
|
||||
"stop-serve": "docker-compose down"
|
||||
}
|
||||
}
|
||||
|
@ -1,55 +1,36 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
php:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: docker/php/Dockerfile
|
||||
args:
|
||||
INSTALL_XDEBUG: "false"
|
||||
INSTALL_XDEBUG: ${ENABLE_XDEBUG}
|
||||
environment:
|
||||
ENABLE_XDEBUG: ${ENABLE_XDEBUG}
|
||||
container_name: app-php
|
||||
working_dir: /var/www/html
|
||||
volumes:
|
||||
- ./docker/php/entrypoint.sh:/entrypoint.sh
|
||||
- ./:/var/www/html:Z
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
entrypoint: >
|
||||
sh -c "
|
||||
if [ ! -d vendor ]; then
|
||||
composer install --no-dev --optimize-autoloader;
|
||||
php scripts/setup.php;
|
||||
fi;
|
||||
php-fpm
|
||||
"
|
||||
entrypoint: [ "sh", "/entrypoint.sh" ]
|
||||
networks:
|
||||
- appnet
|
||||
- apps
|
||||
|
||||
web:
|
||||
image: docker.io/library/httpd:2.4
|
||||
container_name: app-web
|
||||
depends_on: [php]
|
||||
ports:
|
||||
- "8080:80"
|
||||
- "8000:80"
|
||||
volumes:
|
||||
- ./docker/apache/entrypoint.sh:/entrypoint.sh
|
||||
- ./public:/usr/local/apache2/htdocs:Z
|
||||
- ./docker/apache/vhost.conf:/usr/local/apache2/conf/extra/vhost.conf:ro,Z
|
||||
command: >
|
||||
sh -c "
|
||||
# ───────── Module laden ─────────
|
||||
echo 'LoadModule rewrite_module modules/mod_rewrite.so' \
|
||||
>> /usr/local/apache2/conf/httpd.conf;
|
||||
echo 'LoadModule proxy_module modules/mod_proxy.so' \
|
||||
>> /usr/local/apache2/conf/httpd.conf;
|
||||
echo 'LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so' \
|
||||
>> /usr/local/apache2/conf/httpd.conf;
|
||||
# ───────── VHost aktivieren ─────────
|
||||
echo 'Include conf/extra/vhost.conf' \
|
||||
>> /usr/local/apache2/conf/httpd.conf;
|
||||
httpd-foreground
|
||||
"
|
||||
command: [ "sh", "/entrypoint.sh" ]
|
||||
networks:
|
||||
- appnet
|
||||
- apps
|
||||
|
||||
networks:
|
||||
appnet:
|
||||
driver: bridge
|
||||
apps:
|
17
docker/apache/entrypoint.sh
Executable file
17
docker/apache/entrypoint.sh
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo "🚀 Apache Setup beginnt..."
|
||||
|
||||
# ───────── Module laden ─────────
|
||||
echo '📦 Lade Apache-Module...'
|
||||
echo 'LoadModule rewrite_module modules/mod_rewrite.so' >> /usr/local/apache2/conf/httpd.conf
|
||||
echo 'LoadModule proxy_module modules/mod_proxy.so' >> /usr/local/apache2/conf/httpd.conf
|
||||
echo 'LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so' >> /usr/local/apache2/conf/httpd.conf
|
||||
|
||||
# ───────── VHost aktivieren ─────────
|
||||
echo '🔧 Aktiviere vhost.conf...'
|
||||
echo 'Include conf/extra/vhost.conf' >> /usr/local/apache2/conf/httpd.conf
|
||||
|
||||
echo "✅ Starte Apache im Vordergrund..."
|
||||
exec httpd-foreground
|
@ -6,9 +6,13 @@ ARG INSTALL_XDEBUG=false
|
||||
# System-Tools für pecl
|
||||
RUN apt-get update \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
git unzip \
|
||||
git unzip wget curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Composer
|
||||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
|
||||
&& composer --version
|
||||
|
||||
# Conditionally install Xdebug
|
||||
RUN if [ "$INSTALL_XDEBUG" = "true" ]; then \
|
||||
pecl install xdebug \
|
||||
|
16
docker/php/entrypoint.sh
Executable file
16
docker/php/entrypoint.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo "🚀 Starte Container Setup..."
|
||||
|
||||
# Vendor check
|
||||
if [ ! -d vendor ]; then
|
||||
echo "📦 Installiere Composer-Abhängigkeiten..."
|
||||
composer install --no-dev --optimize-autoloader
|
||||
|
||||
echo "⚙️ Führe Setup-Script aus..."
|
||||
php public/index.php
|
||||
fi
|
||||
|
||||
echo "✅ Starte PHP-FPM..."
|
||||
exec php-fpm
|
@ -1,4 +1,10 @@
|
||||
# Configure if Docker Image should include the xdebug extension or not
|
||||
ENABLE_XDEBUG=true
|
||||
|
||||
# define the application context
|
||||
APP_CONTEXT="Production"
|
||||
|
||||
# some 3rd party environment configurations
|
||||
HOLIDAY_SERVER="https://get.api-feiertage.de?years=$currentYear&states=nw"
|
||||
SERVER="https://your.next.cloud/apps/tables/api/1/tables/[$yourTableId]/rows"
|
||||
LOGIN="yourlogin@next.cloud:YOURPASSWORD"
|
@ -103,6 +103,7 @@ class Application {
|
||||
}
|
||||
|
||||
private static function initConsole() {
|
||||
echo "I should do something";
|
||||
|
||||
}
|
||||
|
||||
@ -138,6 +139,7 @@ class Application {
|
||||
}
|
||||
|
||||
private static function runConsole() {
|
||||
echo "I automatically know that I run on the console";
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user