-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
332468b
commit dff8998
Showing
4 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
ARG VERSION="8.3" | ||
|
||
FROM php:${VERSION}-apache | ||
|
||
# Set the working directory in the container | ||
WORKDIR /var/www/html | ||
|
||
# Copy the code into the container | ||
COPY . . | ||
|
||
## Copy custom configurations | ||
COPY ./deployment/apache.conf /etc/apache2/sites-available/000-default.conf | ||
COPY ./deployment/php.ini /usr/local/etc/php/conf.d/custom-php.ini | ||
|
||
# Install PHP extensions and other dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y wget libpq-dev libicu-dev && \ | ||
docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql && \ | ||
docker-php-ext-install intl opcache pgsql pdo pdo_pgsql && \ | ||
pecl install mongodb && \ | ||
docker-php-ext-enable mongodb && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
a2enmod rewrite | ||
|
||
## Install composer | ||
RUN wget https://getcomposer.org/installer && \ | ||
php installer --install-dir=/usr/local/bin/ --filename=composer && \ | ||
rm installer | ||
|
||
## Install application dependencies | ||
ENV APP_ENV=prod | ||
RUN composer install --no-dev --no-interaction --optimize-autoloader | ||
|
||
## Change files owner to apache default user | ||
RUN chown -R www-data:www-data /var/www/html | ||
|
||
## Cleanup | ||
RUN composer dump-autoload --no-dev --classmap-authoritative && \ | ||
rm /usr/local/bin/composer | ||
|
||
# Expose the port Apache listens on | ||
EXPOSE 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
ServerName localhost | ||
<VirtualHost *:80> | ||
DocumentRoot /var/www/html/public | ||
|
||
<Directory /var/www/html/public> | ||
Require all granted | ||
DirectoryIndex index.php | ||
AllowOverride All | ||
</Directory> | ||
|
||
ErrorLog /var/log/apache2/waistline-api_error.log | ||
CustomLog /var/log/apache2/waistline-api_access.log combined | ||
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
; general configuration | ||
memory_limit = 256M | ||
error_reporting = E_ERROR | ||
expose_php = 0 | ||
date.timezone = UTC | ||
session.use_strict_mode = 1 | ||
|
||
; https://symfony.com/doc/current/performance.html | ||
; Use the OPcache class preloading | ||
opcache.preload = /var/www/html/config/preload.php | ||
; required for opcache.preload: | ||
opcache.preload_user = www-data | ||
; maximum memory that OPcache can use to store compiled PHP files | ||
opcache.memory_consumption = 256 | ||
; maximum number of files that can be stored in the cache | ||
opcache.max_accelerated_files = 20000 | ||
; amount of memory used to store interned strings | ||
opcache.interned_strings_buffer = 16 | ||
; check for whether a file has already been cached | ||
opcache.enable_file_override = 1 | ||
|
||
; maximum memory allocated to store the results | ||
realpath_cache_size = 4096K | ||
; save the results for 10 minutes (600 seconds) | ||
realpath_cache_ttl = 600 |