Download the Docker Image at https://hub.docker.com/r/gusdecool/symfony
- Create a project directory and scaffold a Symfony project into it using the image's Composer — no local PHP/Composer install needed. Use the current LTS version, currently 6.4.x:
mkdir my-project && cd my-project
docker run -it --rm -v "$(pwd):/app" gusdecool/symfony:php8.4 composer create-project "symfony/skeleton:6.4.*" /app- Add a
docker-compose.ymlin the project root to run the app. Use the-devtag for local development (includes Xdebug), or drop the-devsuffix for a prod-like image:
services:
app:
image: gusdecool/symfony:php8.4-dev
volumes:
- ./:/app
ports:
- "8090:80"- Start the container:
docker compose up -d- Open http://localhost:8090 in your browser to confirm it works.
Install Symfony, ideally use LTS version. The current LTS version is 6.4.x.
docker run -it --rm -v "$(pwd)/symfony:/app" composer create-project "symfony/skeleton:6.4.*" /appBuild the docker image with command
make php83-buildThen test run the container
make php83-runOpen in browser http://localhost:6000 to make sure it works as expected
Pushes to master trigger .github/workflows/docker-publish.yml, which builds every prod/dev image pair and pushes them to Docker Hub. The workflow needs DOCKERHUB_USERNAME and DOCKERHUB_TOKEN configured as repository secrets.