Files
dmtools/docker/php/Dockerfile
T
FrankandClaude Sonnet 5 9f6763040e Scaffold Symfony 8 app with Bootstrap/DataTables and Docker stack
- Symfony 8.1 webapp skeleton on PHP 8.5 (AssetMapper/importmap, no Node)
- Form-login gate: User entity, security.yaml, SecurityController,
  app:user:create command, initial migration (user + messenger_messages)
- Bootstrap 5 + DataTables layout (base/login/home templates); any
  table.datatable is auto-initialised
- trusted_proxies/headers wired for the shared Nginx Proxy Manager
- Docker (servers only): docker-compose.yml (php:8.5-fpm-alpine,
  nginx:1.30-alpine, mariadb:12.3; host ports 8085/3310; external
  docker_default network) + docker/{Dockerfile,php.ini,nginx,setup.sh,restart.sh}
- .env with CHANGEME placeholders (no secrets), .gitattributes enforces
  LF so the deploy scripts stay runnable on Linux

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-06 14:11:36 +02:00

44 lines
1.1 KiB
Docker

FROM php:8.5-fpm-alpine
RUN apk add --no-cache \
bash \
git \
icu-dev \
libzip-dev \
zip \
unzip \
$PHPIZE_DEPS \
&& docker-php-ext-configure intl \
&& docker-php-ext-install -j"$(nproc)" \
intl \
pdo_mysql \
opcache \
zip \
&& apk del $PHPIZE_DEPS
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
COPY docker/php/php.ini /usr/local/etc/php/conf.d/app.ini
WORKDIR /var/www/html
COPY composer.json composer.lock symfony.lock ./
RUN composer install --no-interaction --no-scripts --no-autoloader --prefer-dist
COPY . .
RUN composer dump-autoload --optimize --classmap-authoritative
# var/ is a .dockerignore'd host concern and gets a named volume mounted over it
# at runtime; create + own it so php-fpm (www-data) can write cache/logs/sessions.
RUN mkdir -p var && chown -R www-data:www-data var
# /var/www/html is bind-mounted from the host at runtime, owned by whoever
# deployed it - keep git from refusing to touch it.
RUN git config --system --add safe.directory /var/www/html
USER www-data
EXPOSE 9000
CMD ["php-fpm"]