Przeglądaj źródła

Add .ddev configuration for local development

Moshe Weitzman 2 lat temu
rodzic
commit
69dfe80550

+ 7 - 0
.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 $@

+ 33 - 0
.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

+ 14 - 0
.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"]

+ 8 - 0
.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