forked from laravelsu/laravel.su
-
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
ba29924
commit 714a0ef
Showing
9 changed files
with
197 additions
and
6 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 |
---|---|---|
|
@@ -13,6 +13,3 @@ trim_trailing_whitespace = false | |
|
||
[*.{yml,yaml}] | ||
indent_size = 2 | ||
|
||
[docker-compose.yml] | ||
indent_size = 4 |
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,11 @@ | ||
laravel.localhost { | ||
tls internal | ||
root * /home/laravel/laravel.su/public | ||
|
||
php_fastcgi php:9000 { | ||
root /home/laravel/laravel.su/public | ||
} | ||
|
||
file_server | ||
encode gzip | ||
} |
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
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,40 @@ | ||
version: "3.8" | ||
|
||
services: | ||
caddy: | ||
image: caddy:2.7-alpine | ||
container_name: laravelsu-caddy | ||
restart: unless-stopped | ||
working_dir: /home/laravel/laravel.su | ||
env_file: | ||
- path: .env | ||
required: false | ||
ports: | ||
- "${LARAVEL_SU_HTTP_PUBLIC_PORT:-80}:80" | ||
- "${LARAVEL_SU_HTTPS_PUBLIC_PORT:-443}:443" | ||
- "${LARAVEL_SU_HTTPS_PUBLIC_PORT:-443}:443/udp" | ||
volumes: | ||
- ./Caddyfile:/etc/caddy/Caddyfile | ||
- .:/home/laravel/laravel.su | ||
depends_on: | ||
- php | ||
networks: | ||
- laravel_su | ||
|
||
php: | ||
build: docker/php | ||
container_name: laravelsu-php | ||
working_dir: /home/laravel/laravel.su | ||
env_file: | ||
- path: .env | ||
required: false | ||
volumes: | ||
- .:/home/laravel/laravel.su | ||
- ./docker/php/php.ini:/usr/local/etc/php/conf.d/local.ini | ||
networks: | ||
- laravel_su | ||
|
||
networks: | ||
laravel_su: | ||
name: laravel_su | ||
driver: bridge |
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,74 @@ | ||
FROM php:8.3-fpm | ||
|
||
WORKDIR "/home/laravel/laravel.su" | ||
|
||
# Fix debconf warnings upon build | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Install Dependencies | ||
# ------------------------------------------------------------------------------ | ||
|
||
RUN apt-get update \ | ||
&& pecl channel-update pecl.php.net \ | ||
&& apt-get -y --no-install-recommends install \ | ||
libsqlite3-dev \ | ||
libzip-dev \ | ||
libicu-dev \ | ||
libpq-dev \ | ||
unzip \ | ||
git \ | ||
curl | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Install PHP | ||
# ------------------------------------------------------------------------------ | ||
|
||
# Composer | ||
RUN curl -sS https://getcomposer.org/installer | \ | ||
php -- --install-dir=/usr/local/bin --filename=composer | ||
|
||
# APCU | ||
RUN pecl install apcu \ | ||
&& docker-php-ext-enable apcu | ||
|
||
# INTL | ||
RUN docker-php-ext-install intl \ | ||
&& docker-php-ext-enable intl | ||
|
||
# PDO PostgreSQL | ||
RUN docker-php-ext-install pdo_sqlite \ | ||
&& docker-php-ext-enable pdo_sqlite | ||
|
||
# Zip | ||
RUN docker-php-ext-install zip \ | ||
&& docker-php-ext-enable zip | ||
|
||
# Opcache | ||
RUN docker-php-ext-install opcache | ||
|
||
# Sockets | ||
RUN docker-php-ext-install sockets | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Cleanup Dependencies | ||
# ------------------------------------------------------------------------------ | ||
|
||
RUN apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* \ | ||
&& ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Copy Runtime Files | ||
# ------------------------------------------------------------------------------ | ||
|
||
COPY --chown=root:root boot.sh /etc/init.d/boot.sh | ||
RUN chmod +x /etc/init.d/boot.sh | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Execute Server | ||
# ------------------------------------------------------------------------------ | ||
|
||
RUN useradd -u 1000 -m laravel | ||
USER laravel | ||
|
||
ENTRYPOINT ["/etc/init.d/boot.sh"] |
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,44 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
echo " > Prepare server APP_ENV=${APP_ENV}" | ||
|
||
echo "$ copy .env.example .env" | ||
cp -n /home/laravel/laravel.su/.env.example /home/laravel/laravel.su/.env | ||
|
||
# NON Production Environment | ||
if [[ ${APP_ENV} != *"production"* ]]; | ||
then | ||
# -------------------------------------------------------------------------- | ||
# Additional installation of DEV dependencies | ||
# -------------------------------------------------------------------------- | ||
echo "$ touch database/database.sqlite" | ||
touch /home/laravel/laravel.su/database/database.sqlite | ||
|
||
echo "$ composer install -n -v" | ||
composer install -n -v | ||
|
||
echo "$ artisan key:generate" | ||
php /home/laravel/laravel.su/artisan key:generate | ||
|
||
echo "$ artisan migrate" | ||
php /home/laravel/laravel.su/artisan migrate | ||
fi | ||
|
||
# ---------------------------------------------------------------------------- | ||
# Warmup | ||
# ---------------------------------------------------------------------------- | ||
|
||
echo "$ artisan cache:clear" | ||
php /home/laravel/laravel.su/artisan cache:clear | ||
|
||
echo "$ artisan config:clear" | ||
php /home/laravel/laravel.su/artisan config:clear | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Execute Server | ||
# ------------------------------------------------------------------------------ | ||
|
||
echo "Ready (APP_ENV=${APP_ENV}, APP_DEBUG=${APP_DEBUG})" | ||
|
||
exec php-fpm |
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 @@ | ||
[PHP] | ||
; Maximum allowed size for uploaded files. | ||
; https://php.net/upload-max-filesize | ||
upload_max_filesize = 100M | ||
|
||
; Maximum number of files that can be uploaded via a single request | ||
max_file_uploads = 20 | ||
|
||
; Maximum size of POST data that PHP will accept. | ||
; Its value may be 0 to disable the limit. It is ignored if POST data reading | ||
; is disabled through enable_post_data_reading. | ||
; https://php.net/post-max-size | ||
post_max_size = 100M | ||
|
||
[Date] | ||
; Defines the default timezone used by the date functions | ||
; https://php.net/date.timezone | ||
date.timezone = UTC | ||
|
||
[opcache] | ||
; Determines if Zend OPCache is enabled | ||
opcache.enable=1 | ||
|
||
; Determines if Zend OPCache is enabled for the CLI version of PHP | ||
opcache.enable_cli=1 |