Dev environment with Symfony and docker
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
art.dambrine 63a8e8163b readme update 4 years ago
docker fix missing unzip dependency 4 years ago
.gitignore fix using composer native and fix php & nginx conf 4 years ago
docker-compose.yml partage host/container UID GID 4 years ago
init.sh fix usage of composer in php container 4 years ago
readme.md readme update 4 years ago

readme.md

Prérequis

  • docker

Mise en place rapide d'un projet symfony avec docker

Lancement du serveur avec docker

UID=${UID} GID=${GID} docker-compose up -d

Initialisation du projet (une fois le serveur up)

./init.sh

WARNING : respectez le nom de projet src du init.sh (important pour l'usage de la conf docker)

Accèder à la CLI php

docker-compose exec php bash
cd src
php bin/console

Pour configurer la base de données local

Pensez à décommenter :

version: '3.8'
services:
  mariadb:
    image: mariadb
    restart: on-failure
    volumes: 
      - database_pokedex:/var/lib/mysql
    ports:
      - '3306:3306'
    environment:
      MYSQL_ROOT_PASSWORD: root_password    
      MYSQL_USER: my_user
      MYSQL_PASSWORD: my_password
      MYSQL_DATABASE: my_pokedex

  nginx:
    image: nginx:1.19-alpine
    restart: on-failure
    volumes:
      - './docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro'
    ports:
      - '80:80'
    depends_on:
      - php
    volumes_from:
      - php
  php:
    build:
      context: .
      dockerfile: docker/php/Dockerfile
    restart: on-failure
    volumes:
      - '.:/usr/src/app'
    user: 1000:1000

volumes: 
  database_pokedex: