mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Removed server_ for better overview
This commit is contained in:
22
roles/docker-mastodon/templates/.env.production.j2
Normal file
22
roles/docker-mastodon/templates/.env.production.j2
Normal file
@@ -0,0 +1,22 @@
|
||||
LOCAL_DOMAIN={{domain}}
|
||||
SINGLE_USER_MODE={{mastodon_single_user_mode}}
|
||||
SECRET_KEY_BASE={{mastodon_secret_key_base}}
|
||||
OTP_SECRET={{mastodon_otp_secret}}
|
||||
VAPID_PRIVATE_KEY={{mastodon_vapid_private_key}}
|
||||
VAPID_PUBLIC_KEY={{mastodon_vapid_public_key}}
|
||||
DB_HOST=database
|
||||
DB_PORT=5432
|
||||
DB_NAME=postgres
|
||||
DB_USER=postgres
|
||||
DB_PASS=
|
||||
REDIS_HOST=redis
|
||||
REDIS_PORT=6379
|
||||
REDIS_PASSWORD=
|
||||
SMTP_SERVER={{system_email_host}}
|
||||
SMTP_PORT={{system_email_port}}
|
||||
SMTP_LOGIN={{system_email_username}}
|
||||
SMTP_PASSWORD={{system_email_password}}
|
||||
SMTP_AUTH_METHOD=plain
|
||||
SMTP_OPENSSL_VERIFY_MODE=none
|
||||
SMTP_ENABLE_STARTTLS=auto
|
||||
SMTP_FROM_ADDRESS=Mastodon <{{system_email_username}}>
|
90
roles/docker-mastodon/templates/docker-compose.yml.j2
Normal file
90
roles/docker-mastodon/templates/docker-compose.yml.j2
Normal file
@@ -0,0 +1,90 @@
|
||||
version: '3'
|
||||
services:
|
||||
database:
|
||||
restart: always
|
||||
image: postgres:14-alpine
|
||||
shm_size: 256mb
|
||||
networks:
|
||||
- internal_network
|
||||
healthcheck:
|
||||
test: ['CMD', 'pg_isready', '-U', 'postgres']
|
||||
volumes:
|
||||
- database:/var/lib/postgresql/data
|
||||
environment:
|
||||
- 'POSTGRES_HOST_AUTH_METHOD=trust'
|
||||
logging:
|
||||
driver: journald
|
||||
redis:
|
||||
restart: always
|
||||
image: redis:7-alpine
|
||||
networks:
|
||||
- internal_network
|
||||
healthcheck:
|
||||
test: ['CMD', 'redis-cli', 'ping']
|
||||
volumes:
|
||||
- redis:/data
|
||||
logging:
|
||||
driver: journald
|
||||
web:
|
||||
image: tootsuite/mastodon:{{mastodon_version}}
|
||||
restart: always
|
||||
env_file: .env.production
|
||||
command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"
|
||||
networks:
|
||||
- external_network
|
||||
- internal_network
|
||||
healthcheck:
|
||||
# prettier-ignore
|
||||
test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:3000/health || exit 1']
|
||||
ports:
|
||||
- "127.0.0.1:{{http_port}}:3000"
|
||||
depends_on:
|
||||
- database
|
||||
- redis
|
||||
volumes:
|
||||
- data:/mastodon/public/system
|
||||
logging:
|
||||
driver: journald
|
||||
streaming:
|
||||
image: tootsuite/mastodon:{{mastodon_version}}
|
||||
restart: always
|
||||
env_file: .env.production
|
||||
command: node ./streaming
|
||||
networks:
|
||||
- external_network
|
||||
- internal_network
|
||||
healthcheck:
|
||||
# prettier-ignore
|
||||
test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1']
|
||||
ports:
|
||||
- "127.0.0.1:{{stream_port}}:4000"
|
||||
depends_on:
|
||||
- database
|
||||
- redis
|
||||
logging:
|
||||
driver: journald
|
||||
sidekiq:
|
||||
image: tootsuite/mastodon:{{mastodon_version}}
|
||||
restart: always
|
||||
env_file: .env.production
|
||||
command: bundle exec sidekiq
|
||||
depends_on:
|
||||
- database
|
||||
- redis
|
||||
networks:
|
||||
- external_network
|
||||
- internal_network
|
||||
volumes:
|
||||
- data:/mastodon/public/system
|
||||
healthcheck:
|
||||
test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]
|
||||
logging:
|
||||
driver: journald
|
||||
volumes:
|
||||
database:
|
||||
redis:
|
||||
data:
|
||||
networks:
|
||||
external_network:
|
||||
internal_network:
|
||||
internal: true
|
46
roles/docker-mastodon/templates/mastodon.conf.j2
Normal file
46
roles/docker-mastodon/templates/mastodon.conf.j2
Normal file
@@ -0,0 +1,46 @@
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
server {
|
||||
server_name {{domain}};
|
||||
|
||||
{% include 'roles/server_native-letsencrypt/templates/ssl_header.j2' %}
|
||||
|
||||
keepalive_timeout 70;
|
||||
sendfile on;
|
||||
client_max_body_size 80m;
|
||||
|
||||
gzip on;
|
||||
gzip_disable "msie6";
|
||||
gzip_vary on;
|
||||
gzip_proxied any;
|
||||
gzip_comp_level 6;
|
||||
gzip_buffers 16 8k;
|
||||
gzip_http_version 1.1;
|
||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
||||
|
||||
add_header Strict-Transport-Security "max-age=31536000";
|
||||
|
||||
{% include 'roles/server_native-docker-reverse-proxy/templates/proxy_pass.conf.j2' %}
|
||||
|
||||
location /api/v1/streaming {
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header Proxy "";
|
||||
|
||||
proxy_pass http://127.0.0.1:{{stream_port}};
|
||||
proxy_buffering off;
|
||||
proxy_redirect off;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
|
||||
tcp_nodelay on;
|
||||
}
|
||||
|
||||
error_page 500 501 502 503 504 /500.html;
|
||||
}
|
Reference in New Issue
Block a user