You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.2 KiB

3 years ago
---
- 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
- copy:
src: build
dest: /usr/share/monica
3 years ago
- docker_compose:
project_name: monica
build: yes
pull: yes
3 years ago
definition:
version: "3.4"
services:
app:
build: /usr/share/monica/build
3 years ago
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_MAILER=smtp
3 years ago
- 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