Skip to content

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

License

Notifications You must be signed in to change notification settings

devgine/symfony-golden-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Symfony docker image

Build GitHub top language Packages retention policy

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

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

Use as base image in 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

# 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

# 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

Releases

No releases published

Packages