Skip to content

nkarthickannan/docker-drupal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dockerized Symfony development environment

Docker Symfony PHP

A complete Docker development stack for Symfony applications with pre-configured services and debugging support.

Features

  • 🐋 Full Docker integration
  • 🚀 Symfony 7.x optimized environment
  • 🔧 Pre-configured services:
    • Nginx web server
    • PHP-FPM 8.3 with Xdebug
    • PostgreSQL database
    • RabbitMQ message broker
    • MailHog email testing
    • pgAdmin database management
  • 🔒 Automatic SSL with mkcert
  • 🐛 PHPStorm/Xdebug integration
  • 📦 Environment variable configuration
  • ♻️ Healthchecks

Pre-requisites

Getting started

1. Clone repository

git clone https://github.com/nkarthickannan/docker-symfony.git
cd docker-symfony

2. Configure environment

cp .env.sample .env

Edit .env file with your preferred credentials.

3. Build & start containers

docker-compose up -d --build

4. Initialize Symfony project

docker-compose exec phpfpm composer create-project symfony/skeleton:"7.4.*" .

Or clone the existing GIT repo

git clone <GIT_CLONE_URL> app

Configuration

Environment variables

Variable Description Default
DOMAIN Base domain name app.local
POSTGRES_* PostgreSQL credentials -
RABBITMQ_* RabbitMQ credentials -
PGADMIN_* pgAdmin credentials -

Services overview

Replace app.local with your domain name mentioned in .env file

Service Port Default URL Credentials
Nginx 80/443 https://app.local -
PHP-FPM 9000 - -
PostgreSQL 5432 - .env values
pgAdmin 8080 https://pgadmin.app.local .env values
RabbitMQ 15672 https://rabbitmq.app.local .env values
MailHog 8025 https://mailhog.app.local -

SSL setup

Certificates are automatically generated using mkcert. To trust certificates:

mkcert -install

Debugging with PHPStorm

See detailed PHPStorm Configuration Guide

Common commands

Start/Stop Containers

docker-compose start
docker-compose stop

View logs

docker-compose logs -f [service_name]

Run Composer

bin/composer [command]

Access database

docker-compose exec db psql -U $POSTGRES_USER $POSTGRES_DB

Troubleshooting

Port conflicts

sudo lsof -i :80 # Find process using port

Xdebug not connecting

  1. Check PHPStorm listener status
  2. Validate path mappings in PHPStorm

SSL certificate errors

docker-compose exec nginx cat /etc/nginx/ssl/rootCA.pem > local-root-ca.pem
# Install certificate for your OS

Services not starting

Check health status:

docker-compose ps

License

Distributed under the MIT License. See LICENSE for more information.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors