Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php service #82

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
18 changes: 18 additions & 0 deletions php/dockerfile
Original file line number Diff line number Diff line change
@@ -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/
30 changes: 30 additions & 0 deletions php/vhosts/vhosts.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<VirtualHost *:80>
ServerName localhost

DocumentRoot /var/www/docker-symfony-project/public
DirectoryIndex /index.php

<Directory /var/www/docker-symfony-project/public>
AllowOverride None
Order Allow,Deny
Allow from All

FallbackResource /index.php
</Directory>

#uncomment the following lines if you install assets as symlinks
#or run into problems when compiling LESS/Sass/CoffeeScript assets
# <Directory /var/www/project>
# Options FollowSymlinks
# </Directory>
# 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 <app-secret-id>
#SetEnv DATABASE_URL "mysql://db_user:db_pass@host:3306/db_name"
</VirtualHost>