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
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 |
Variable | Default | Description |
---|---|---|
SG_SERVER_ENABLED | true | Status of symfony server (to be disabled in production) |
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
After the built-in, server will be started.
Visit http://localhost:8000 in your web browser.
Connect to the container
docker exec -ti CONTAINER_ID sh
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
#...
# localhost:8000
services:
symfony:
image: ghcr.io/devgine/symfony-golden:latest
volumes:
- HOST_DIRECTORY:/var/www/symfony
ports:
- 8000:8000
Access : http://localhost:8000
First of all, configure nginx as recommended by symfony community
https://symfony.com/doc/current/setup/web_server_configuration.html#nginx
# 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