Skip to content

Repository files navigation

Docker Image for Symfony Framework

Download the Docker Image at https://hub.docker.com/r/gusdecool/symfony

How to use

  1. 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
  1. Add a docker-compose.yml in the project root to run the app. Use the -dev tag for local development (includes Xdebug), or drop the -dev suffix for a prod-like image:
services:
  app:
    image: gusdecool/symfony:php8.4-dev
    volumes:
      - ./:/app
    ports:
      - "8090:80"
  1. Start the container:
docker compose up -d
  1. Open http://localhost:8090 in your browser to confirm it works.

How to develop

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.*" /app

Build the docker image with command

make php83-build

Then test run the container

make php83-run

Open in browser http://localhost:6000 to make sure it works as expected

Continuous deployment

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.

About

Docker image to run Symfony framework

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages