-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Valentin Sickert <[email protected]>
- Loading branch information
Showing
6 changed files
with
95 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,14 @@ | ||
<VirtualHost *:80> | ||
|
||
ServerAdmin webmaster@localhost | ||
DocumentRoot /var/www/html/public/ | ||
|
||
<Directory /var/www/> | ||
AllowOverride All | ||
Require all granted | ||
</Directory> | ||
|
||
ErrorLog ${APACHE_LOG_DIR}/error.log | ||
CustomLog ${APACHE_LOG_DIR}/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,12 @@ | ||
#!/bin/bash | ||
set -e; # Exit immediately if a command exits with a non-zero status. | ||
|
||
if [ "$APP_ENV" = "production" ]; then | ||
/usr/local/bin/php /var/www/html/artisan migrate --force; | ||
else | ||
/usr/local/bin/php /var/www/html/artisan migrate; | ||
fi | ||
|
||
/usr/local/bin/php /var/www/html/artisan optimize; | ||
|
||
exec apache2-foreground; |
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,9 @@ | ||
[opcache] | ||
opcache.enable=1 | ||
opcache.revalidate_freq=0 | ||
opcache.validate_timestamps=0 | ||
opcache.max_accelerated_files=10000 | ||
opcache.memory_consumption=192 | ||
opcache.max_wasted_percentage=10 | ||
opcache.interned_strings_buffer=16 | ||
opcache.jit_buffer_size=100M |
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,11 @@ | ||
.git | ||
.env | ||
.idea | ||
.vscode | ||
node_modules | ||
vendor | ||
storage/framework/cache/** | ||
storage/framework/sessions/** | ||
storage/framework/testing/** | ||
storage/framework/views/** | ||
storage/logs/** |
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 |
---|---|---|
|
@@ -16,3 +16,6 @@ indent_size = 2 | |
|
||
[docker-compose.yml] | ||
indent_size = 4 | ||
|
||
[*.sh] | ||
end_of_line = lf |
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,46 @@ | ||
# Stage 1: Build | ||
FROM composer:lts as build | ||
|
||
WORKDIR /app | ||
|
||
COPY . /app/ | ||
|
||
# Install dependencies | ||
RUN composer install --prefer-dist --no-dev --optimize-autoloader --no-interaction --no-progress | ||
|
||
# Stage 2: Production | ||
FROM php:8.1-apache as production | ||
|
||
ENV APP_ENV=production | ||
ENV APP_DEBUG=false | ||
|
||
# Install Postgres driver | ||
RUN apt-get update && \ | ||
apt-get install -y libpq-dev | ||
|
||
# Install PHP extensions | ||
RUN docker-php-ext-configure opcache --enable-opcache && \ | ||
docker-php-ext-install pdo pdo_mysql pdo_pgsql | ||
|
||
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" | ||
|
||
# Copy opcache config | ||
COPY .docker/php/conf.d/opcache.ini /usr/local/etc/php/conf.d/opcache.ini | ||
|
||
# Copy application | ||
COPY --from=build /app /var/www/html | ||
|
||
# Copy apache config | ||
COPY .docker/apache/vhost.conf /etc/apache2/sites-available/000-default.conf | ||
|
||
# Copy entrypoint | ||
COPY .docker/entrypoint.sh /entrypoint.sh | ||
|
||
# Copy configure script | ||
RUN chown -R www-data:www-data /var/www/ && \ | ||
a2enmod rewrite | ||
|
||
EXPOSE 80 | ||
|
||
# Run Entrypoint | ||
ENTRYPOINT [ "/entrypoint.sh" ] |