eidyev/symfony-webapp-server

By eidyev

Updated 9 months ago

Symfony Webapp Server a Docker image for Symfony apps with Nginx, PHP 8.X FPM, Supervisor and more.

Image
Languages & frameworks
Developer tools
Web servers
0

10K+

eidyev/symfony-webapp-server repository overview

Docker Pulls Image Size GitHub Stars

Symfony WebApp Server

A production‑ready Docker image for Symfony apps with Nginx + PHP‑FPM + Supervisor + Composer. Two flavors: development (with Xdebug & Symfony CLI) and production (optimized with OPcache).

🏷️ Available Tags

  • Development: php8.0-dev, php8.1-dev, php8.2-dev, php8.3-dev, php8.4-dev, latest-dev
  • Production: php8.0-prod, php8.1-prod, php8.2-prod, php8.3-prod, php8.4-prod, latest-prod, latest

🚀 Base Docker Image Optimized for Symfony Web applications.

Develop and Production ready ! and PHP 8.0, 8.1, 8.2, 8.3, 8.4+

📦 What's Included?

Base Stack
  • Debian Bookworm (slim)
  • Nginx - Web server
  • PHP 8.X-FPM - With over 50 installed extentions, you won't miss any
  • Composer - PHP dependency manager
  • Symfony-cli
  • Supervisor - Process management
  • Debug tools
  • Diagnostic tools

Main extensions:

Core, PDO, Opcache, APCu, Redis, Memcached, MySQL, PostgreSQL, SQLite, MongoDB, LDAP, AMQP (RabbitMQ), GD, Imagick, SOAP, XML, YAML, ZIP, cURL, Swoole, gRPC, Protobuf, Intl, MBString, BCMath, GMP, and many more...

Development Tools (only development target)
  • Symfony CLI
  • Xdebug 3.x
  • XHProf - Profiling
  • PHPDbg - Debugger

🚀 Quick Start

Run container

Development (mounts your app as volume)

docker run -d \
  -p 8080:80 \
  -v $(pwd)/my-app:/var/www/html \
  --name symfony-dev \
  eidyev/symfony-webapp-server:php-8.3-dev

# Production
docker run -d \
  -p 80:80 \
  -v $(pwd)/my-app:/var/www/html \
  --name symfony-prod \
  eidyev/symfony-webapp-server:php-8.3-prod

🐳 Docker Compose (basic)


# --- EXAMPLE --- docker-compose.yml ---------------------------------

networks:
  net:
    driver: bridge

services:
 
  dev-server:
    image: symfony-webapp-server:php-8.3-dev
    container_name: webdev
    ports:
      - "8080:80"
    volumes:
    #  webapp is your symfony app folder
      - ./webapp:/var/www/html
    depends_on:
      - db
    networks:
      - net
    profiles:
      - development


  prod-server:
    image: symfony-webapp-server:php-8.3-prod
    container_name: webprod
    ports:
      - "8081:80"
    depends_on:
      - db
    networks:
      - net
    restart: unless-stopped
    profiles:
      - production


  db:
    image: postgres:16-alpine 
    container_name: database
    environment:
      POSTGRES_DB: app_db
      POSTGRES_USER: app_user
      POSTGRES_PASSWORD: app_password
    healthcheck:
      test: [ "CMD", "pg_isready", "-d", "${DB_DATABASE:-app}", "-U", "${DB_USER:-app}" ]
      timeout: 5s
      retries: 5
      start_period: 60s
    volumes:
      - postgres_data:/var/lib/postgresql/data # Volumen para persistir los datos
    networks:
      - net
    profiles:
      - development
      - production

volumes:
  postgres_data:
    driver: local

ℹ️ Notes

  • Container expects your symfony app in /var/www/html/
  • Container expects webroot at /var/www/html/public.
  • HTTPS should be handled by your reverse proxy (Traefik / Cloudflare Tunnel / NPM / Caddy).

Optional deploy/ folder (first-run & update automation)

If your Symfony app includes a deploy/ folder at the project root (mounted as /var/www/html/deploy inside the container), the image can automatically run custom commands on first run and on version changes.

Expected structure:

/deploy/ firstrun.cmds # commands executed ONLY once (first container start) updtrun.cmds # commands executed when the app version changes version # current app version (e.g. 1.0.0)

  • firstrun.cmds – runs only the first time the container starts with that volume (e.g. composer install, DB creation, initial migrations, seeds, etc.).

  • updtrun.cmds – runs only when deploy/version changes (e.g. migrations, cache warmup, data updates).

  • version – plain text file with any version string you like (1, 1.0.0, 2025-11-22, …).

To apply an update:

Change your code.

Update the value in deploy/version (for example 1.0.0 → 1.1.0).

Restart the container:

 docker restart <container-name>

On restart, the entrypoint will:

Run firstrun.cmds only once (first ever start).

Run updtrun.cmds only when the version value changes.

Do nothing if the version is the same.


👤 Author Eidy EV < [email protected] > GitHub: @eidyev

If this project helps you, consider giving it a star ⭐ on GitHub.

More details in https://github.com/eidyev/symfony-webapp-server

Tag summary

Content type

Image

Digest

sha256:92c7c4b47

Size

180.7 MB

Last updated

9 months ago

docker pull eidyev/symfony-webapp-server