-
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.
- Loading branch information
0 parents
commit c53669e
Showing
130 changed files
with
12,534 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,17 @@ | ||
FROM php:8.1-fpm | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends libssl-dev zlib1g-dev curl git unzip libxml2-dev libpq-dev libzip-dev && \ | ||
pecl install apcu && \ | ||
docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql && \ | ||
docker-php-ext-install -j$(nproc) zip opcache intl pdo_pgsql pgsql && \ | ||
docker-php-ext-enable apcu pdo_pgsql sodium && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
COPY --from=composer /usr/bin/composer /usr/bin/composer | ||
|
||
WORKDIR /var/www/html | ||
|
||
#CMD composer i -o ; wait-for-it db:5432 -- artisan migrate ; php-fpm | ||
|
||
EXPOSE 9000 |
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,33 @@ | ||
server { | ||
charset utf-8; | ||
client_max_body_size 128M; | ||
listen 80 default_server; | ||
listen [::]:80 default_server; | ||
server_name laravel-test.com; | ||
root /var/www/html/public; | ||
index index.php; | ||
|
||
error_log /var/log/nginx/api_error.log; | ||
access_log /var/log/nginx/api_access.log; | ||
|
||
location / { | ||
try_files $uri /index.php$is_args$args; | ||
} | ||
|
||
location ~ ^/index\.php(/|$) { | ||
fastcgi_pass laravel_php:9000; | ||
fastcgi_split_path_info ^(.+\.php)(/.*)$; | ||
include fastcgi_params; | ||
fastcgi_buffer_size 128k; | ||
fastcgi_buffers 4 256k; | ||
fastcgi_busy_buffers_size 256k; | ||
|
||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; | ||
fastcgi_param DOCUMENT_ROOT $realpath_root; | ||
internal; | ||
} | ||
|
||
location ~ \.php$ { | ||
return 404; | ||
} | ||
} |
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,4 @@ | ||
date.timezone = Europe/Kiev | ||
|
||
display_errors = 1 | ||
error_reporting = E_ALL |
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,6 @@ | ||
psql --command "CREATE USER docker WITH SUPERUSER PASSWORD 'docker';" &&\ | ||
createdb -O docker docker | ||
|
||
# echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/10.14/main/pg_hba.conf | ||
|
||
# echo "listen_addresses='*'" >> /etc/postgresql/10.14/main/postgresql.conf |
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 @@ | ||
echo "PHP version: ${PHP_VERSION}" | ||
|
||
if ! shopt -oq posix; then | ||
if [ -f /usr/share/bash-completion/bash_completion ]; then | ||
. /usr/share/bash-completion/bash_completion | ||
elif [ -f /etc/bash_completion.d/yii ]; then | ||
. /etc/bash_completion.d/yii | ||
fi | ||
fi |
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,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
if [ -n "${GITHUB_API_TOKEN}" ] | ||
then | ||
composer.phar config -g github-oauth.github.com ${GITHUB_API_TOKEN} | ||
fi | ||
|
||
composer.phar "$@" |
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,28 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
# Set permissions based on ENV variable (debian only) | ||
if [ -x "$(command -v usermod)" ] ; then | ||
usermod -u ${PHP_USER_ID} www-data | ||
fi | ||
|
||
# Enable xdebug by ENV variable | ||
if [ 0 -ne "${PHP_ENABLE_XDEBUG:-0}" ] ; then | ||
docker-php-ext-enable xdebug | ||
echo "Enabled xdebug" | ||
fi | ||
|
||
export PS1="\e[0;35mphd \e[0;37m\u container \h \e[0;32m\w \e[0;0m\n$ " | ||
|
||
# first arg is `-f` or `--some-option` | ||
if [ "${1#-}" != "$1" ]; then | ||
if [ -x "$(command -v apache2-foreground)" ]; then | ||
set -- apache2-foreground "$@" | ||
elif [ -x "$(command -v php-fpm)" ]; then | ||
set -- php-fpm "$@" | ||
else | ||
set -- php "$@" | ||
fi | ||
fi | ||
|
||
exec "$@" |
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,29 @@ | ||
; Required timezone | ||
date.timezone = UTC | ||
|
||
; General settings | ||
memory_limit=128M | ||
max_execution_time=30 | ||
sys_temp_dir=/tmp | ||
upload_max_filesize=512M | ||
upload_tmp_dir=/tmp | ||
post_max_size=512M | ||
|
||
; Security, Debug & Logs | ||
expose_php=off | ||
cgi.fix_pathinfo=0 | ||
log_errors=on | ||
error_reporting=E_ALL | ||
html_errors=on | ||
xdebug.default_enable=off | ||
|
||
; Opcache | ||
opcache.memory_consumption=128 | ||
opcache.interned_strings_buffer=8 | ||
opcache.max_accelerated_files=4000 | ||
;opcache.validate_timestamps=off | ||
opcache.fast_shutdown=0 | ||
opcache.enable_cli=1 | ||
|
||
; PHP language options | ||
short_open_tag=0 |
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,10 @@ | ||
;zend_extension=xdebug.so | ||
xdebug.remote_enable=1 | ||
xdebug.remote_autostart=1 | ||
xdebug.remote_connect_back=0 | ||
;;; if you are on macOS, use host.docker.internal to identify the host machine, due to a network limitation on mac (https://docs.docker.com/docker-for-mac/networking/#port-mapping) | ||
;;; otherwise find host ip | ||
xdebug.remote_host=host.docker.internal | ||
;;; avoid standard port (9000) conflicts using 9005 port | ||
xdebug.remote_port=9005 | ||
xdebug.idekey=PHPStorm |
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,18 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
### DOCKER ENVs ### | ||
LOCAL_PROJECT_PATH=/home/r22/projects/www/laravel_test/ | ||
LOCAL_NGINX_PORT=8093 | ||
LOCAL_POSTGRES_PORT=54324 | ||
### ### | ||
|
||
APP_NAME=Laravel | ||
APP_ENV=local | ||
APP_KEY=base64:oc8lu4B0vqBWNmyM0HyEyzicg/4LKPN7WCWRq8y5YS0= | ||
APP_DEBUG=true | ||
APP_URL=http://localhost:80 | ||
|
||
LOG_CHANNEL=stack | ||
LOG_DEPRECATIONS_CHANNEL=null | ||
LOG_LEVEL=debug | ||
|
||
DB_CONNECTION=pgsql | ||
DB_HOST=laravel_db | ||
DB_PORT=5432 | ||
DB_DATABASE=laravel_test | ||
DB_USERNAME=postgres | ||
DB_PASSWORD=postgres | ||
|
||
BROADCAST_DRIVER=log | ||
CACHE_DRIVER=file | ||
FILESYSTEM_DISK=local | ||
QUEUE_CONNECTION=database | ||
SESSION_DRIVER=file | ||
SESSION_LIFETIME=120 | ||
|
||
MEMCACHED_HOST=127.0.0.1 | ||
|
||
REDIS_HOST=127.0.0.1 | ||
REDIS_PASSWORD=null | ||
REDIS_PORT=6379 | ||
|
||
MAIL_MAILER=smtp | ||
MAIL_HOST=mailhog | ||
MAIL_PORT=1025 | ||
MAIL_USERNAME=null | ||
MAIL_PASSWORD=null | ||
MAIL_ENCRYPTION=null | ||
MAIL_FROM_ADDRESS="[email protected]" | ||
MAIL_FROM_NAME="${APP_NAME}" | ||
|
||
AWS_ACCESS_KEY_ID= | ||
AWS_SECRET_ACCESS_KEY= | ||
AWS_DEFAULT_REGION=us-east-1 | ||
AWS_BUCKET= | ||
AWS_USE_PATH_STYLE_ENDPOINT=false | ||
|
||
PUSHER_APP_ID= | ||
PUSHER_APP_KEY= | ||
PUSHER_APP_SECRET= | ||
PUSHER_APP_CLUSTER=mt1 | ||
|
||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" | ||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" |
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,52 @@ | ||
APP_NAME=Laravel | ||
APP_ENV=local | ||
APP_KEY= | ||
APP_DEBUG=true | ||
APP_URL=http://localhost | ||
|
||
LOG_CHANNEL=stack | ||
LOG_DEPRECATIONS_CHANNEL=null | ||
LOG_LEVEL=debug | ||
|
||
DB_CONNECTION=mysql | ||
DB_HOST=127.0.0.1 | ||
DB_PORT=3306 | ||
DB_DATABASE=laravel | ||
DB_USERNAME=root | ||
DB_PASSWORD= | ||
|
||
BROADCAST_DRIVER=log | ||
CACHE_DRIVER=file | ||
FILESYSTEM_DISK=local | ||
QUEUE_CONNECTION=sync | ||
SESSION_DRIVER=file | ||
SESSION_LIFETIME=120 | ||
|
||
MEMCACHED_HOST=127.0.0.1 | ||
|
||
REDIS_HOST=127.0.0.1 | ||
REDIS_PASSWORD=null | ||
REDIS_PORT=6379 | ||
|
||
MAIL_MAILER=smtp | ||
MAIL_HOST=mailhog | ||
MAIL_PORT=1025 | ||
MAIL_USERNAME=null | ||
MAIL_PASSWORD=null | ||
MAIL_ENCRYPTION=null | ||
MAIL_FROM_ADDRESS="[email protected]" | ||
MAIL_FROM_NAME="${APP_NAME}" | ||
|
||
AWS_ACCESS_KEY_ID= | ||
AWS_SECRET_ACCESS_KEY= | ||
AWS_DEFAULT_REGION=us-east-1 | ||
AWS_BUCKET= | ||
AWS_USE_PATH_STYLE_ENDPOINT=false | ||
|
||
PUSHER_APP_ID= | ||
PUSHER_APP_KEY= | ||
PUSHER_APP_SECRET= | ||
PUSHER_APP_CLUSTER=mt1 | ||
|
||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" | ||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" |
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,10 @@ | ||
* text=auto | ||
|
||
*.blade.php diff=html | ||
*.css diff=css | ||
*.html diff=html | ||
*.md diff=markdown | ||
*.php diff=php | ||
|
||
/.github export-ignore | ||
CHANGELOG.md export-ignore |
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 @@ | ||
/node_modules | ||
/public/hot | ||
/public/storage | ||
/storage/*.key | ||
/vendor | ||
.env.backup | ||
.phpunit.result.cache | ||
Homestead.json | ||
Homestead.yaml | ||
npm-debug.log | ||
yarn-error.log | ||
/.idea | ||
/.vscode | ||
/.docker/data |
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 @@ | ||
php: | ||
preset: laravel | ||
disabled: | ||
- no_unused_imports | ||
finder: | ||
not-name: | ||
- index.php | ||
js: | ||
finder: | ||
not-name: | ||
- webpack.mix.js | ||
css: true |
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,18 @@ | ||
### Try to register a user | ||
POST {{host}}/user/auth | ||
Content-Type: application/json | ||
|
||
{ | ||
"email": "[email protected]", | ||
"password": "content23" | ||
} | ||
|
||
### Try to register a user with token already provided | ||
POST {{host}}/user/auth | ||
Content-Type: application/json | ||
Authorization: Bearer {{auth_token}} | ||
|
||
{ | ||
"email": "[email protected]", | ||
"password": "content23" | ||
} |
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,6 @@ | ||
{ | ||
"dev": { | ||
"host": "http://localhost:8093/api", | ||
"auth_token": "9|PY8c7rn3hJtg1g7ex9hYFZjT6mWADMWVKrxZoh7a" | ||
} | ||
} |
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,10 @@ | ||
### Try to register a user | ||
PATCH {{host}}/user/profile | ||
Content-Type: application/json | ||
Authorization: Bearer {{auth_token}} | ||
Accept: application/json | ||
|
||
{ | ||
"timezone": "Europe/Kiev", | ||
"language": "RU" | ||
} |
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,20 @@ | ||
### Try to register a user | ||
POST {{host}}/user/register | ||
Content-Type: application/json | ||
|
||
{ | ||
"email": "testtest@com", | ||
"password": "content23", | ||
"password_confirmation": "content23" | ||
} | ||
|
||
|
||
### Try to register a user with not valid data | ||
POST {{host}}/user/register | ||
Content-Type: application/json | ||
|
||
{ | ||
"email": "testtest.com", | ||
"password": "cont", | ||
"password_confirmation": "content23" | ||
} |
Oops, something went wrong.