2 Commits

Author SHA1 Message Date
Frank
1fddcda12f Message on reload to hopefully stop the user. 2026-01-06 14:32:37 +01:00
Frank
2b51ca0a68 Layout done, probably need rework later on 2026-01-06 13:24:40 +01:00
3 changed files with 15 additions and 58 deletions

View File

@@ -5,7 +5,7 @@ services:
php:
build:
context: ..
dockerfile: docker/php/Dockerfile
dockerfile: php/Dockerfile
container_name: escapepage-php
volumes:
- ../:/var/www/html:delegated
@@ -18,23 +18,6 @@ services:
- backend
restart: unless-stopped
php-worker:
build:
context: ..
dockerfile: docker/php/Dockerfile
container_name: escapepage-php-worker
volumes:
- ../:/var/www/html:delegated
environment:
APP_ENV: dev
depends_on:
- database
- mercure
command: ["php", "bin/console", "messenger:consume", "async", "-vv"]
networks:
- backend
restart: unless-stopped
nginx:
image: nginx:1.29.4-alpine
container_name: escapepage-nginx

View File

@@ -1,20 +1,11 @@
FROM php:8.3-fpm-alpine
FROM php:8.5.1-fpm-alpine3.23
# Install system deps
RUN apk add --no-cache \
bash \
git \
icu-dev \
libzip-dev \
oniguruma-dev \
g++ \
make \
nodejs \
npm
RUN apk add --no-cache bash git icu-dev libzip-dev oniguruma-dev
# Install PHP extensions
RUN docker-php-ext-configure intl \
&& docker-php-ext-install -j$(nproc) intl pdo pdo_mysql opcache zip
&& docker-php-ext-install -j$(nproc) intl pdo pdo_mysql opcache
# Install composer
ENV COMPOSER_ALLOW_SUPERUSER=1 \
@@ -22,7 +13,7 @@ ENV COMPOSER_ALLOW_SUPERUSER=1 \
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
# Configure PHP
COPY docker/php/php.ini $PHP_INI_DIR/conf.d/zz-custom.ini
COPY php.ini $PHP_INI_DIR/conf.d/zz-custom.ini
WORKDIR /var/www/html

View File

@@ -66,15 +66,12 @@ dc up "${BUILD_ARGS[@]}"
# Helper to run commands in php container
pexec() { dc exec -T php "$@"; }
# Wait for database to be healthy (mariadb/mysql)
# Wait for database to be healthy (mariadb)
printf "Waiting for database to be healthy..."
# Use docker inspect health status
DB_HEALTH=""
for i in {1..60}; do
DB_ID=$(dc ps -q database 2>/dev/null || true)
if [ -n "$DB_ID" ]; then
DB_HEALTH=$(docker inspect -f '{{.State.Health.Status}}' "$DB_ID" 2>/dev/null || true)
fi
DB_HEALTH=$(docker inspect -f '{{.State.Health.Status}}' "$(docker ps --filter name=_database_ --format '{{.ID}}' | head -n1)" 2>/dev/null || true)
if [ "$DB_HEALTH" = "healthy" ]; then
echo " OK"
break
@@ -82,7 +79,7 @@ for i in {1..60}; do
printf "."
sleep 2
if [ "$i" -eq 60 ]; then
echo -e "\nWarning: database health check not healthy yet, continuing anyway."
echo "\nWarning: database health check not healthy yet, continuing anyway."
fi
done
@@ -103,23 +100,11 @@ if grep -q '^APP_SECRET=$' "$ROOT_DIR/.env" 2>/dev/null; then
fi
# Prepare DB
echo "Creating database if it doesn't exist..."
pexec php bin/console doctrine:database:create --if-not-exists
echo "Running migrations..."
pexec php bin/console doctrine:migrations:migrate -n
pexec php bin/console doctrine:database:create --if-not-exists || true
pexec php bin/console doctrine:migrations:migrate -n || true
# Import JS deps (Importmap/Asset Mapper)
if [ -f "$ROOT_DIR/importmap.php" ]; then
pexec php bin/console importmap:install || true
fi
# Build assets if using Webpack Encore
if [ -f "$ROOT_DIR/package.json" ]; then
echo "Installing npm dependencies..."
pexec npm install
echo "Building assets..."
pexec npm run build
fi
APP_URL=http://localhost:8080
MAILPIT_URL=http://localhost:8025
@@ -132,12 +117,10 @@ Open the app: $APP_URL
Mailpit (dev): $MAILPIT_URL
Common commands:
(cd "$DOCKER_DIR" && $DOCKER_COMPOSE logs -f nginx)
(cd "$DOCKER_DIR" && $DOCKER_COMPOSE logs -f php)
(cd "$DOCKER_DIR" && $DOCKER_COMPOSE logs -f php-worker)
(cd "$DOCKER_DIR" && $DOCKER_COMPOSE exec php bash)
(cd "$DOCKER_DIR" && $DOCKER_COMPOSE exec php npm run watch)
(cd "$DOCKER_DIR" && $DOCKER_COMPOSE down)
(cd docker && $DOCKER_COMPOSE logs -f nginx)
(cd docker && $DOCKER_COMPOSE logs -f php)
(cd docker && $DOCKER_COMPOSE exec php bash)
(cd docker && $DOCKER_COMPOSE down)
You can re-run this script any time. Use --no-build to skip rebuilding images.
EOT