Sign inSign up

teamdunet/symfony

By teamdunet

Updated over 6 years ago

symfony latest v5.0.4 - php v7.3 - apache v2.4

Image
1

312

teamdunet/symfony repository overview

Docker Symfony v5.0.4

Sources
Environments
ServiceVersion
Apache2.4
PHP7.3
Builds
Docker Compose
version: '3.7'

services:

  mysql:
    image: mysql:5.7
    command: --default-authentication-plugin=mysql_native_password
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_USER: www-data
      MYSQL_PASSWORD: www-password
      MYSQL_DATABASE: symfony
    volumes:
      - mysql_data:/var/lib/mysql:rw
    networks:
      - local

  symfony:
    image: teamdunet/symfony:latest
    depends_on:
      - mysql
    links:
      - mysql
    volumes:
      - ./:/var/www/html:rw
    ports:
      - 80:80
      - 443:443
    networks:
      - local

networks:
  local:

volumes:
  mysql_data:

Start

docker-compose up -d

Install

docker-compose exec symfony composer install
Portainer template
[
  {
    "type": 1,
    "title": "Symfony",
    "description": "PHP framework Symfony",
    "categories": ["developer"],
    "platform": "linux",
    "logo": "https://symfony.com/logos/symfony_black_03.png",
    "image": "teamdunet/symfony:latest",
    "ports": [
      "80/tcp",
      "443/tcp"
    ]
  }
]
Extra
Install Makefile
sudo apt install make
Create your Makefile
.PHONY: help up down db-drop db-create db-migrate db-diff db-install cache-clear install
.DEFAULT_GOAL= help

include .env

help:
	@grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-20s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'

up: ## Launch all the container
	docker-compose up -d

down: ## Stop all the container
	docker-compose down -v

composer-install: ## Install Symfony dependencies
	docker-compose exec symfony composer install --no-suggest --no-progress

db-drop: ## Delete the database
	docker-compose exec symfony bin/console doctrine:database:drop --force --if-exists

db-create: ## Create the database
	docker-compose exec symfony bin/console doctrine:database:create --if-not-exists

db-migrate: ## Update the database
	docker-compose exec symfony bin/console doctrine:migrations:migrate -n

db-diff: ## Display database change
	docker-compose exec symfony bin/console doctrine:migrations:diff

db-install: db-drop db-create #db-migrate

assets-install: ## Install Symfony dependencies
	docker-compose exec symfony bin/console assets:install -n

cache-clear: ## Clear cache
	docker-compose exec symfony php bin/console cache:clear

install: up composer-install db-install assets-install cache-clear ## Launch the project
Usages
make help                 Help
make up                   Launch all the container
make down                 Stop all the container
make composer-install     Install Symfony dependencies
make db-drop              Delete the database
make db-create            Create the database
make db-migrate           Update the database
make db-diff              Display database change
make cache-clear          Clear cache
make install              Install the project

Tag summary

Content type

Image

Digest

Size

112.4 MB

Last updated

over 6 years ago

docker pull teamdunet/symfony