diff --git a/.server/nginx/site.conf b/.server/nginx/site.conf index 87e998fc..223b961a 100644 --- a/.server/nginx/site.conf +++ b/.server/nginx/site.conf @@ -51,11 +51,15 @@ server { } location ~ \.php$ { - try_files $uri = 404; + try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php7.1-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_buffers 4 256k; + fastcgi_busy_buffers_size 256k; + fastcgi_temp_file_write_size 256k; + fastcgi_intercept_errors off; include fastcgi_params; } diff --git a/ansible/automatic-backup.yml b/ansible/automatic-backup.yml new file mode 100644 index 00000000..6e7835f8 --- /dev/null +++ b/ansible/automatic-backup.yml @@ -0,0 +1,16 @@ +--- +- hosts: all + remote_user: root + pre_tasks: + - assert: + that: + - "S3_BUCKET != ''" + tasks: + - name: 'Ensure that it can establish connection to specific bucket' + command: /usr/local/bin/aws s3 ls s3://{{ S3_BUCKET }}/backups/ + - name: 'Ensure that backup to S3 cron task exists' + cron: + name: "Sync backups with S3" + minute: "0" + hour: "2" + job: "/usr/local/bin/aws s3 sync /root/backups s3://{{ S3_BUCKET }}/backups/ >/dev/null 2>&1" diff --git a/ansible/provision.yml b/ansible/provision.yml index b2488abd..10153fda 100644 --- a/ansible/provision.yml +++ b/ansible/provision.yml @@ -55,6 +55,13 @@ apt: name: htop state: present + - name: Install awscli + pip: + name: awscli + - name: Create .aws dir + file: + path: "~/.aws" + state: directory - name: Disallow password authentication lineinfile: dest: /etc/ssh/sshd_config diff --git a/ansible/templates/production-compose.yml b/ansible/templates/production-compose.yml index 429d7dca..fb486b68 100644 --- a/ansible/templates/production-compose.yml +++ b/ansible/templates/production-compose.yml @@ -18,6 +18,8 @@ services: image: "{{ DOCKER_APP_IMAGE }}:{{ APP_VERSION | default('latest', true) }}" restart: always depends_on: + - proxy_server + - docker_gen_service - redis_server environment: OVERRIDE_UMASK: "022" diff --git a/ansible/templates/staging-compose.yml b/ansible/templates/staging-compose.yml index 2c696863..b23b92ac 100644 --- a/ansible/templates/staging-compose.yml +++ b/ansible/templates/staging-compose.yml @@ -19,6 +19,8 @@ services: image: "{{ DOCKER_APP_IMAGE }}:{{ APP_VERSION | default('latest', true) }}" restart: always depends_on: + - proxy_server + - docker_gen_service - redis_server environment: OVERRIDE_UMASK: "022"