An open API service indexing awesome lists of open source software.

https://github.com/kingdestinythe1st/symfony-framework-setup-for-docker

This is the easiest PHP Symfony Framework setup for Docker to run. It uses the Symfony CLI tool and should only be used for development environment only.
https://github.com/kingdestinythe1st/symfony-framework-setup-for-docker

docker docker-compose docker-container docker-image dockerfile symfony symfony-di-container symfony-docker symfony-docker-composer symfony-docker-template symfony-dockerize

Last synced: 2 months ago
JSON representation

This is the easiest PHP Symfony Framework setup for Docker to run. It uses the Symfony CLI tool and should only be used for development environment only.

Awesome Lists containing this project

README

        

# Symfony Basic Docker Setup

This repository provides the simplest and most efficient Docker setup for running Symfony applications. It includes a Dockerfile for building the container and a Docker Compose file for easy management.

## YOU WILL NOT FIND ANY DOCKER SETUP FOR PHP SYMFONY FRAMEWORK AS SIMPLE AND EASY TO USE AS THIS
**Author:** Destiny Diekedie
**Contact:** [Upwork](https://www.upwork.com/freelancers/~01fe13ad4d04129ce1) [LinkedIn](https://www.linkedin.com/in/destiny-diekedie/)

## Features

* **.env file:** Comes with a .env file to allow you customize the setup to your requirement.
* **Latest Ubuntu Version 25.04 base image:** Provides a stable and reliable environment.
* **PHP 8.4:** Uses the latest stable PHP version for optimal performance and features.
* **Node.js 23.11.0, NVM 0.39.7 and npm:** Includes Node.js, NVM and NPM for frontend development.
* **Composer:** Installs Composer for dependency management.
* **Symfony CLI:** Installs the Symfony CLI for development tools.
* **Graceful shutdown:** The `entrypoint.sh` script ensures the Symfony server stops cleanly when the container is stopped.
* **Port 8000:** The Symfony server runs on port 8000, making it easy to access.
* **Volume mapping:** Maps your local `app/` directory to `/var/www/html/` in the container, allowing for seamless code changes.
* **Docker Compose:** Simplifies the process of building and running the container.
* **Timezone Set:** Sets the timezone to where ever you want. The default timezone is set to Africa/Lagos in the .env file

## Prerequisites

* Docker installed on your system.
* Docker Compose installed on your system.

## Getting Started

1. **Clone the repository:**

```bash
git clone
cd
```

2. **Create your Symfony project directory:**

Create an `app` directory in the root of your project. This directory will be mounted into the Docker container.

```bash
mkdir app
```

3. **Place your Symfony project inside the app directory or Leave the app directory empty:**
You can leave the app directory empty or place your existing Symfony project inside the newly created app directory.
In case you left the app directory empty, make sure to restart the container or symfony server after installing a new Symfony project. The Symfony CLI tool will not restart the server for you.

4. **Build and run the Docker container:**

```bash
docker-compose up --build
```

This command will build the Docker image and start the container.

5. **Access your Symfony application:**

Open your web browser and navigate to `http://localhost:8000`.

6. **Stop the container:**

```bash
docker-compose down
```

## Directory Structure