mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 22:16:15 +00:00
use redis for queues, sessions and cache (#618)
This commit is contained in:
@ -15,3 +15,6 @@ MAIL_PASSWORD=null
|
|||||||
MAIL_ENCRYPTION=null
|
MAIL_ENCRYPTION=null
|
||||||
MAIL_FROM_ADDRESS="noreply@${APP_NAME}"
|
MAIL_FROM_ADDRESS="noreply@${APP_NAME}"
|
||||||
MAIL_FROM_NAME="${APP_NAME}"
|
MAIL_FROM_NAME="${APP_NAME}"
|
||||||
|
|
||||||
|
REDIS_HOST=redis
|
||||||
|
REDIS_PORT=6379
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'default' => env('CACHE_DRIVER', 'file'),
|
'default' => env('CACHE_DRIVER', 'redis'),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
@ -44,19 +44,23 @@
|
|||||||
],
|
],
|
||||||
|
|
||||||
'default' => [
|
'default' => [
|
||||||
'driver' => 'database',
|
'driver' => 'redis',
|
||||||
'table' => 'jobs',
|
'connection' => 'default',
|
||||||
'queue' => 'default',
|
'queue' => 'default',
|
||||||
'timeout' => 90,
|
'timeout' => 90,
|
||||||
'retry_after' => 600,
|
'retry_after' => 600,
|
||||||
|
'block_for' => null,
|
||||||
|
'after_commit' => false,
|
||||||
],
|
],
|
||||||
|
|
||||||
'ssh' => [
|
'ssh' => [
|
||||||
'driver' => 'database',
|
'driver' => 'redis',
|
||||||
'table' => 'jobs',
|
'connection' => 'default',
|
||||||
'queue' => 'default',
|
'queue' => 'default',
|
||||||
'timeout' => 600,
|
'timeout' => 600,
|
||||||
'retry_after' => 600,
|
'retry_after' => 600,
|
||||||
|
'block_for' => null,
|
||||||
|
'after_commit' => false,
|
||||||
],
|
],
|
||||||
|
|
||||||
],
|
],
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'driver' => env('SESSION_DRIVER', 'database'),
|
'driver' => env('SESSION_DRIVER', 'redis'),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
@ -16,7 +16,7 @@ public function up(): void
|
|||||||
public function down(): void
|
public function down(): void
|
||||||
{
|
{
|
||||||
Schema::table('workers', function (Blueprint $table) {
|
Schema::table('workers', function (Blueprint $table) {
|
||||||
$table->dropColumn('name');
|
// $table->dropColumn('name');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -21,7 +21,18 @@ services:
|
|||||||
- '.:/var/www/html'
|
- '.:/var/www/html'
|
||||||
networks:
|
networks:
|
||||||
- vito
|
- vito
|
||||||
depends_on: { }
|
depends_on:
|
||||||
|
- redis
|
||||||
|
redis:
|
||||||
|
image: 'redis:alpine'
|
||||||
|
volumes:
|
||||||
|
- 'vito-redis:/data'
|
||||||
|
networks:
|
||||||
|
- vito
|
||||||
|
healthcheck:
|
||||||
|
test: [ "CMD", "redis-cli", "ping" ]
|
||||||
|
retries: 3
|
||||||
|
timeout: 5s
|
||||||
worker:
|
worker:
|
||||||
build:
|
build:
|
||||||
context: ./vendor/laravel/sail/runtimes/8.4
|
context: ./vendor/laravel/sail/runtimes/8.4
|
||||||
@ -43,6 +54,11 @@ services:
|
|||||||
- vito
|
- vito
|
||||||
depends_on:
|
depends_on:
|
||||||
- app
|
- app
|
||||||
|
- redis
|
||||||
networks:
|
networks:
|
||||||
vito:
|
vito:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
volumes:
|
||||||
|
vito-redis:
|
||||||
|
driver: local
|
||||||
|
name: vito-redis
|
||||||
|
@ -8,7 +8,7 @@ ENV DEBIAN_FRONTEND=noninteractive
|
|||||||
RUN apt-get update && apt-get upgrade -y && apt-get autoremove -y
|
RUN apt-get update && apt-get upgrade -y && apt-get autoremove -y
|
||||||
|
|
||||||
# requirements
|
# requirements
|
||||||
RUN apt-get install -y software-properties-common curl zip unzip gcc nginx git \
|
RUN apt-get install -y software-properties-common curl zip unzip gcc nginx redis-server git \
|
||||||
cron gnupg gosu curl ca-certificates zip unzip supervisor libcap2-bin libpng-dev \
|
cron gnupg gosu curl ca-certificates zip unzip supervisor libcap2-bin libpng-dev \
|
||||||
dnsutils librsvg2-bin fswatch wget openssh-client \
|
dnsutils librsvg2-bin fswatch wget openssh-client \
|
||||||
&& add-apt-repository ppa:ondrej/php -y \
|
&& add-apt-repository ppa:ondrej/php -y \
|
||||||
|
@ -9,6 +9,7 @@ services:
|
|||||||
PASSWORD: "password"
|
PASSWORD: "password"
|
||||||
APP_KEY: "base64:UodiJrx3DkcMlizmoimNlDn+yd4q5f2VbkBay19rJwM="
|
APP_KEY: "base64:UodiJrx3DkcMlizmoimNlDn+yd4q5f2VbkBay19rJwM="
|
||||||
APP_PORT: 8000
|
APP_PORT: 8000
|
||||||
|
APP_URL: "http://localhost:8000"
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
- 'host.docker.internal:host-gateway'
|
- 'host.docker.internal:host-gateway'
|
||||||
ports:
|
ports:
|
||||||
|
@ -58,6 +58,7 @@ chown -R www-data:www-data /var/www/html \
|
|||||||
&& chmod -R 755 /var/www/html/storage /var/www/html/bootstrap/cache
|
&& chmod -R 755 /var/www/html/storage /var/www/html/bootstrap/cache
|
||||||
service php8.4-fpm start
|
service php8.4-fpm start
|
||||||
|
|
||||||
|
service redis-server start
|
||||||
service nginx start
|
service nginx start
|
||||||
|
|
||||||
php /var/www/html/artisan migrate --force
|
php /var/www/html/artisan migrate --force
|
||||||
|
@ -108,6 +108,12 @@ sed -i "s/post_max_size = .*/post_max_size = 1G/" /etc/php/${V_PHP_VERSION}/fpm/
|
|||||||
curl -sS https://getcomposer.org/installer -o composer-setup.php
|
curl -sS https://getcomposer.org/installer -o composer-setup.php
|
||||||
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
|
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
|
||||||
|
|
||||||
|
# redis
|
||||||
|
apt install redis-server -y
|
||||||
|
service redis enable
|
||||||
|
service redis start
|
||||||
|
|
||||||
|
|
||||||
# setup website
|
# setup website
|
||||||
export COMPOSER_ALLOW_SUPERUSER=1
|
export COMPOSER_ALLOW_SUPERUSER=1
|
||||||
export V_REPO="https://github.com/vitodeploy/vito.git"
|
export V_REPO="https://github.com/vitodeploy/vito.git"
|
||||||
|
Reference in New Issue
Block a user