Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/devgine/symfony-golden-image

Docker image based on official php, composer and alpine docker images. This image contains symfony framework with all its required extensions.
https://github.com/devgine/symfony-golden-image

alpine alpine-linux composer devops docker dockerfile multi-environment php symfony symfony-cli

Last synced: 3 days ago
JSON representation

Docker image based on official php, composer and alpine docker images. This image contains symfony framework with all its required extensions.

Awesome Lists containing this project

README

        

# Symfony docker image

[![Build](https://github.com/devgine/symfony-golden-image/actions/workflows/build.yaml/badge.svg?branch=main)](https://github.com/devgine/symfony-golden-image/actions/workflows/build.yaml)
![GitHub top language](https://img.shields.io/github/languages/top/devgine/symfony-golden-image)
[![Packages retention policy](https://github.com/devgine/symfony-golden-image/actions/workflows/packages-retention-policy.yaml/badge.svg?branch=main)](https://github.com/devgine/symfony-golden-image/actions/workflows/packages-retention-policy.yaml)

![cover.png](.readme/images/cover.png)

## About
This repository is a docker image based on official php, composer and alpine docker images.

This image contains symfony framework installed with all its required extensions.

It's useful to easily set symfony project up

## Image details
### Available versions
Below is the list of all the available images by Symfony and PHP versions:



SF Version
PHP Version
Docker image tag




7.2
8.4

ghcr.io/devgine/symfony-golden:latest

ghcr.io/devgine/symfony-golden:v7.2-php8.4-alpine



8.3

ghcr.io/devgine/symfony-golden:v7.2-php8.3-alpine



8.2

ghcr.io/devgine/symfony-golden:v7.2-php8.2-alpine



7.1
8.4

ghcr.io/devgine/symfony-golden:v7.1-php8.4-alpine



8.3

ghcr.io/devgine/symfony-golden:v7.1-php8.3-alpine



8.2

ghcr.io/devgine/symfony-golden:v7.1-php8.2-alpine



7.0
8.4

ghcr.io/devgine/symfony-golden:v7.0-php8.4-alpine



8.3

ghcr.io/devgine/symfony-golden:v7.0-php8.3-alpine



8.2

ghcr.io/devgine/symfony-golden:v7.0-php8.2-alpine



6.4
8.4

ghcr.io/devgine/symfony-golden:v6.4-php8.4-alpine



8.3

ghcr.io/devgine/symfony-golden:v6.4-php8.3-alpine



8.2

ghcr.io/devgine/symfony-golden:v6.4-php8.2-alpine



8.1
ghcr.io/devgine/symfony-golden:v6.4-php8.1-alpine

### Environment variables

| Variable | Default | Description |
|-------------------|---------|---------------------------------------------------------|
| SG_SERVER_ENABLED | true | Status of symfony server (to be disabled in production) |

## Usage
### Install from the command line
```shell
docker run -d -p 8000:8000 -v HOST_DIRECTORY:/var/www/symfony ghcr.io/devgine/symfony-golden:latest
```
> You can change latest by a specific tag

> [Available versions](https://github.com/devgine/symfony-golden-image/pkgs/container/symfony-golden/versions)

After the built-in, server will be started.

Visit http://localhost:8000 in your web browser.

**Connect to the container**
```shell
docker exec -ti CONTAINER_ID sh
```

### Use as base image in Dockerfile
```dockerfile
FROM ghcr.io/devgine/symfony-golden:latest

# Add your custom instructions here
# example: install mongodb driver
RUN set -xe \
&& apk add --no-cache --update --virtual .phpize-deps $PHPIZE_DEPS openssl curl-dev openssl-dev \
&& pecl install mongodb
#...
```

### Use with docker compose
```yaml
# localhost:8000
services:
symfony:
image: ghcr.io/devgine/symfony-golden:latest
volumes:
- HOST_DIRECTORY:/var/www/symfony
ports:
- 8000:8000
```

**Access :** http://localhost:8000

### Use with nginx
First of all, configure nginx as recommended by symfony community

https://symfony.com/doc/current/setup/web_server_configuration.html#nginx

```yaml
# compose.yaml
services:
nginx:
image: nginx:latest
volumes:
- HOST_DIRECTORY/public:/var/www/symfony/public
- ./nginx.conf:/etc/nginx/conf.d/default.conf
ports:
- 80:80

symfony:
image: ghcr.io/devgine/symfony-golden:latest
environment:
SG_SERVER_ENABLED: false # do not run symfony server
volumes:
- HOST_DIRECTORY:/var/www/symfony
```

**Access :** http://localhost

## References

* [Symfony releases](https://symfony.com/releases)
* [PHP releases](https://www.php.net/supported-versions.php)