From 69dfe805502b2443523f0c8951b7cee9f35f4585 Mon Sep 17 00:00:00 2001 From: Moshe Weitzman Date: Thu, 22 Dec 2022 11:57:03 -0500 Subject: [PATCH 1/2] Add .ddev configuration for local development --- .ddev/commands/redis/redis-cli | 7 +++++++ .ddev/config.yaml | 33 +++++++++++++++++++++++++++++++++ .ddev/docker-compose.redis.yaml | 14 ++++++++++++++ .ddev/redis/redis.conf | 8 ++++++++ 4 files changed, 62 insertions(+) create mode 100755 .ddev/commands/redis/redis-cli create mode 100644 .ddev/config.yaml create mode 100644 .ddev/docker-compose.redis.yaml create mode 100644 .ddev/redis/redis.conf diff --git a/.ddev/commands/redis/redis-cli b/.ddev/commands/redis/redis-cli new file mode 100755 index 00000000..27bf575b --- /dev/null +++ b/.ddev/commands/redis/redis-cli @@ -0,0 +1,7 @@ +#!/bin/bash +#ddev-generated +## Description: Run redis-cli inside the redis container +## Usage: redis-cli [flags] [args] +## Example: "redis-cli KEYS *" or "ddev redis-cli INFO" or "ddev redis-cli --version" + +redis-cli -p 6379 -h redis $@ diff --git a/.ddev/config.yaml b/.ddev/config.yaml new file mode 100644 index 00000000..955a7f48 --- /dev/null +++ b/.ddev/config.yaml @@ -0,0 +1,33 @@ +name: pixelfed +type: laravel +docroot: public +php_version: "8.1" +webserver_type: nginx-fpm +database: + type: mariadb + version: "10.4" +disable_settings_management: true +web_environment: + - DB_CONNECTION=mysql + - DB_HOST=ddev-pixelfed-db + - DB_DATABASE=db + - DB_USERNAME=db + - DB_PASSWORD=db + - REDIS_HOST=ddev-pixelfed-redis + - MAIL_DRIVER=smtp + - MAIL_HOST=localhost + - MAIL_PORT=1025 + - MAIL_USERNAME=null + - MAIL_PASSWORD=null + - MAIL_ENCRYPTION=null + - APP_KEY=placeholder + - APP_NAME=PixelfedTest + - APP_ENV=local + - APP_KEY=base64:lwX95GbNWX3XsucdMe0XwtOKECta3h/B+p9NbH2jd0E= + - APP_DEBUG=true + - APP_URL=https://pixelfed.ddev.site + - APP_DOMAIN=pixelfed.ddev.site + - ADMIN_DOMAIN=pixelfed.ddev.site + - SESSION_DOMAIN=pixelfed.ddev.site + - "TRUST_PROXIES=*" + - LOG_CHANNEL=stack diff --git a/.ddev/docker-compose.redis.yaml b/.ddev/docker-compose.redis.yaml new file mode 100644 index 00000000..fab05033 --- /dev/null +++ b/.ddev/docker-compose.redis.yaml @@ -0,0 +1,14 @@ +#ddev-generated +version: '3.6' +services: + redis: + container_name: ddev-${DDEV_SITENAME}-redis + image: redis:6 + # These labels ensure this service is discoverable by ddev. + labels: + com.ddev.site-name: ${DDEV_SITENAME} + com.ddev.approot: $DDEV_APPROOT + volumes: + - ".:/mnt/ddev_config" + - "./redis:/usr/local/etc/redis" + command: ["redis-server", "/usr/local/etc/redis/redis.conf"] diff --git a/.ddev/redis/redis.conf b/.ddev/redis/redis.conf new file mode 100644 index 00000000..0b5216eb --- /dev/null +++ b/.ddev/redis/redis.conf @@ -0,0 +1,8 @@ +# Redis configuration. +# #ddev-generated +# Example configuration files for reference: +# http://download.redis.io/redis-stable/redis.conf +# http://download.redis.io/redis-stable/sentinel.conf + +maxmemory 2048mb +maxmemory-policy allkeys-lfu From 7f8f4a2f438297ea58cbd02f1fb6e677f618bdc5 Mon Sep 17 00:00:00 2001 From: Moshe Weitzman Date: Thu, 22 Dec 2022 14:25:21 -0500 Subject: [PATCH 2/2] Remove name --- .ddev/config.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.ddev/config.yaml b/.ddev/config.yaml index 955a7f48..0ca08a26 100644 --- a/.ddev/config.yaml +++ b/.ddev/config.yaml @@ -1,4 +1,3 @@ -name: pixelfed type: laravel docroot: public php_version: "8.1"