[meta] monica

pull/35/head
Alpha Chen 3 years ago
parent 46db54fa70
commit 7116c83b0a

@ -0,0 +1,72 @@
---
- hosts: monica
tasks:
- file:
path: /usr/share/monica/{{ item }}
state: directory
loop:
- app
- db
- php
- copy:
src: php.ini
dest: /usr/share/monica/php/uploads.ini
- docker_compose:
project_name: monica
definition:
version: "3.4"
services:
app:
image: monica
depends_on:
- db
ports:
- 8080:80
environment:
- APP_ENV=production
- APP_KEY={{ monica_app_key }}
- DB_HOST=db
- DB_USERNAME=monica
- DB_PASSWORD={{ monica_db_password }}
- MAIL_HOST={{ sendgrid_mail_host }}
- MAIL_PORT={{ sendgrid_mail_port }}
- MAIL_USERNAME={{ sendgrid_mail_username }}
- MAIL_PASSWORD={{ sendgrid_mail_password }}
- MAIL_ENCRYPTION={{ monica_mail_encryption }}
- MAIL_FROM_ADDRESS={{ monica_mail_from_address }}
- MAIL_FROM_NAME=Monica
- APP_EMAIL_NEW_USERS_NOTIFICATION={{ monica_app_email_new_users_notification }}
volumes:
- /usr/share/monica/app:/var/www/html/storage
- /usr/share/monica/php/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
restart: always
db:
image: mysql:5.7
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=true
- MYSQL_DATABASE=monica
- MYSQL_USER=monica
- MYSQL_PASSWORD={{ monica_db_password }}
volumes:
- /usr/share/monica/db:/var/lib/mysql
restart: always
- template:
src: monica.nginx
dest: /etc/nginx/sites-available/monica.conf
notify: Restart nginx
- file:
src: /etc/nginx/sites-available/monica.conf
dest: /etc/nginx/sites-enabled/monica.conf
state: link
notify: Restart nginx
handlers:
- name: Restart nginx
service:
name: nginx
state: restarted

@ -0,0 +1,37 @@
server {
server_name {{ monica_domain }};
listen 80;
listen [::]:80;
location / {
return https://$server_name$request_uri;
}
}
server {
server_name {{ monica_domain }};
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_trusted_certificate /etc/letsencrypt/live/{{ monica_domain }}/chain.pem;
ssl_certificate /etc/letsencrypt/live/{{ monica_domain }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ monica_domain }}/privkey.pem;
ssl_stapling on;
ssl_stapling_verify on;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
location / {
proxy_pass http://127.0.0.1:8080;
}
}

@ -0,0 +1,2 @@
[www]
upload_max_filesize = 10M
Loading…
Cancel
Save