Dockerize Project

This commit is contained in:
Jan-Marlon Leibl 2023-11-03 21:17:49 +01:00
commit e679d02b41
205 changed files with 17941 additions and 0 deletions

1
docker/.env Normal file
View file

@ -0,0 +1 @@
PROJECT_NAME=ventry-hosting-service

1
docker/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
db

20
docker/apache/Dockerfile Normal file
View file

@ -0,0 +1,20 @@
FROM php:8.2-apache
RUN apt-get update -y && apt-get upgrade -y
RUN apt-get install -y vim curl 7zip libicu-dev
RUN curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php \
&& php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer
RUN curl -sS https://get.symfony.com/cli/installer | bash && mv /root/.symfony5/bin/symfony /usr/local/bin/symfony
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug \
&& docker-php-ext-configure intl \
&& docker-php-ext-install pdo pdo_mysql intl opcache
COPY ./php.ini "${PHP_INI_DIR}/"
COPY ./xdebug.ini ./opcache.ini "${PHP_INI_DIR}/conf.d"/
RUN a2enmod rewrite

View file

@ -0,0 +1,29 @@
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/public
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>

4
docker/apache/xdebug.ini Normal file
View file

@ -0,0 +1,4 @@
;xdebug.mode=develop,debug
;xdebug.start_with_request=yes
;xdebug.discover_client_host=0
;xdebug.client_host=host.docker.internal

28
docker/docker-compose.yml Normal file
View file

@ -0,0 +1,28 @@
services:
app:
build:
context: .
dockerfile: apache/Dockerfile
container_name: ${PROJECT_NAME}-app
restart: always
working_dir: /var/www/
ports:
- '80:80'
volumes:
- ../:/var/www
- ./apache/sites/symfony-skeleton.conf:/etc/apache2/sites-available/000-default.conf
database:
image: mysql:8.0
container_name: ${PROJECT_NAME}-db
restart: always
environment:
MYSQL_DATABASE: ${PROJECT_NAME}
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'root'
MYSQL_ROOT_PASSWORD: 'root'
ports:
- '3306:3306'
expose:
- '3306'
volumes:
- ./db:/var/lib/mysql

8
docker/opcache.ini Normal file
View file

@ -0,0 +1,8 @@
opcache.enable=1
opcache.revalidate_freq=0
opcache.validate_timestamps=1
opcache.max_accelerated_files=20000
opcache.memory_consumption=256
opcache.max_wasted_percentage=10
opcache.interned_strings_buffer=16
opcache.fast_shutdown=1

1996
docker/php.ini Normal file

File diff suppressed because it is too large Load diff

4
docker/xdebug.ini Normal file
View file

@ -0,0 +1,4 @@
;xdebug.mode=develop,debug
;xdebug.start_with_request=yes
;xdebug.discover_client_host=0
;xdebug.client_host=host.docker.internal