diff --git a/docker-compose.yml b/docker-compose.yml index 5711c0f..393faa7 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -81,6 +81,43 @@ services: restart: on-failure profiles: ["all", "contracts"] + db: + image: mysql + container_name: mysql_symfony_docker + restart: always + volumes: + - db-data:/var/lib/mysql + environment: + MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' + networks: + - dev + + phpmyadmin: + image: phpmyadmin + container_name: phpmyadmin_symfony_docker + restart: always + depends_on: + - db + ports: + - 8083:80 + environment: + - PMA_ARBITRARY=1 + + www: + build: php + container_name: www_symfony_docker + ports: + - 8741:80 + volumes: + - ./php/vhosts:/etc/apache2//sites-enabled + - ./:/var/www + networks: + - dev + +networks: + dev: + volumes: mysql-db: mongo-db: + db-data: diff --git a/php/dockerfile b/php/dockerfile new file mode 100644 index 0000000..7cb9a95 --- /dev/null +++ b/php/dockerfile @@ -0,0 +1,18 @@ +FROM php:8.1-apache + +RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf + +RUN apt-get update \ + && apt-get install -y --no-install-recommends locales apt-utils git libicu-dev g++ libpng-dev libxml2-dev libzip-dev libonig-dev libxslt-dev; + +RUN echo "en_US.UTF-8 UTF-8"> /etc/locale.gen && \ + echo "fr_FR.UTF-8 UTF-8" >> /etc/locale.gen && \ + locale-gen +RUN curl -sSk https://getcomposer.org/installer | php -- --disable-tls && \ + mv composer.phar /usr/local/bin/composer + +RUN docker-php-ext-configure intl +RUN docker-php-ext-install pdo pdo_mysql gd opcache intl zip calendar dom mbstring zip gd xsl +RUN pecl install apcu && docker-php-ext-enable apcu + +WORKDIR /var/www/ \ No newline at end of file diff --git a/php/vhosts/vhosts.conf b/php/vhosts/vhosts.conf new file mode 100644 index 0000000..7b60506 --- /dev/null +++ b/php/vhosts/vhosts.conf @@ -0,0 +1,30 @@ + + ServerName localhost + + DocumentRoot /var/www/docker-symfony-project/public + DirectoryIndex /index.php + + + AllowOverride None + Order Allow,Deny + Allow from All + + FallbackResource /index.php + + + #uncomment the following lines if you install assets as symlinks + #or run into problems when compiling LESS/Sass/CoffeeScript assets + # + # Options FollowSymlinks + # + # optionally disable the fallback resource for the asset directories + # which will allow Apache to return a 404 error when files are + # not found instead of passing the request to Symfony + + ErrorLog /var/log/apache2/docker-symfony-project_error.log + CustomLog /var/log/apache2/project_access.log combined + + #optionally set the value of the environment variables used in the application #SetEnv APP_ENV prod + #SetEnv APP_SECRET + #SetEnv DATABASE_URL "mysql://db_user:db_pass@host:3306/db_name" + \ No newline at end of file