optimized mastodon and pixelfed implementation

This commit is contained in:
Kevin Veen-Birkenbach 2022-11-16 16:04:01 +01:00
parent 9d90cd640b
commit 1ca210608a
6 changed files with 36 additions and 26 deletions

View File

@ -17,5 +17,8 @@
notify: recreate mastodon
- name: copy configuration
template: src=.env.production.j2 dest={{docker_compose_mastodon_path}}.env.production
template:
src: .env.production.j2
dest: "{{docker_compose_mastodon_path}}.env.production"
force: no
notify: recreate mastodon

View File

@ -1,4 +1,9 @@
# role docker-pixelfed
## hard cleanup
```bash
docker-compose down
docker volume rm pixelfed_application_data pixelfed_database pixelfed_redis_data
```
## further information
- https://hub.docker.com/r/zknt/pixelfed

View File

@ -1,22 +1,25 @@
---
- name: recieve pixelfed certificates
command: certbot certonly --agree-tos --email {{administrator_email}} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{item}}
loop: "{{domains}}"
- name: recieve {{domain}} certificate
command: certbot certonly --agree-tos --email {{administrator_email}} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{domain}}
- name: configure pixelfed nginx configurations
vars:
client_max_body_size: "2M"
domain: "{{item}}"
template: src=roles/native-docker-reverse-proxy/templates/domain.conf.j2 dest=/etc/nginx/conf.d/{{ item }}.conf
loop: "{{domains}}"
- name: configure {{domain}}.conf
template: src=roles/native-docker-reverse-proxy/templates/domain.conf.j2 dest=/etc/nginx/conf.d/{{domain}}.conf
notify: restart nginx
- name: "create /home/administrator/docker-compose/pixelfed/"
- name: "create {{docker_compose_path}}"
file:
path: "/home/administrator/docker-compose/pixelfed/"
path: "{{docker_compose_path}}"
state: directory
mode: 0755
- name: add docker-compose.yml
template: src=docker-compose.yml.j2 dest=/home/administrator/docker-compose/pixelfed/docker-compose.yml
template: src=docker-compose.yml.j2 dest={{docker_compose_path}}docker-compose.yml
notify: recreate pixelfed
- name: add env
template:
src: env.j2
dest: "{{docker_compose_path}}env"
mode: '770'
force: no
notify: recreate pixelfed

View File

@ -30,7 +30,7 @@ services:
depends_on:
- database
- redis
- app
- application
healthcheck:
test: php artisan horizon:status | grep running
interval: 60s
@ -56,7 +56,7 @@ services:
logging:
driver: journald
volumes:
- redis:/data
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 1s

View File

@ -1,8 +1,8 @@
## Crypto
APP_KEY=
APP_KEY={{pixelfed_app_key}}
## General Settings
APP_NAME="Pixelfed Prod"
APP_NAME="Pixelfed on Veen.World"
APP_ENV=production
APP_DEBUG=false
APP_URL=https://{{domain}}
@ -56,16 +56,12 @@ MAIL_ENCRYPTION=tls
## Databases (MySQL)
DB_CONNECTION=mysql
DB_DATABASE=pixelfed_prod
DB_HOST=db
DB_PASSWORD=pixelfed_db_pass
DB_DATABASE=pixelfed
DB_HOST=database
DB_PASSWORD="{{pixelfed_database_password}}"
DB_PORT=3306
DB_USERNAME=pixelfed
# pass the same values to the db itself
MYSQL_DATABASE=pixelfed_prod
MYSQL_PASSWORD=pixelfed_db_pass
MYSQL_RANDOM_ROOT_PASSWORD=true
MYSQL_USER=pixelfed
MYSQL_DATABASE="pixelfed"
MYSQL_USER="pixelfed"
MYSQL_PASSWORD="{{pixelfed_database_password}}"
@ -75,7 +71,7 @@ MYSQL_ROOT_PASSWORD="{{pixelfed_database_password}}"
REDIS_CLIENT=phpredis
REDIS_SCHEME=tcp
REDIS_HOST=redis
REDIS_PASSWORD=redis_password
#REDIS_PASSWORD=
REDIS_PORT=6379
REDIS_DATABASE=0
@ -137,3 +133,5 @@ TRUST_PROXIES="*"
## Passport
#PASSPORT_PRIVATE_KEY=
#PASSPORT_PUBLIC_KEY=
ENABLE_CONFIG_CACHE=true

View File

@ -0,0 +1 @@
docker_compose_path: "/home/administrator/docker-compose/pixelfed/"