Skip to content

Commit

Permalink
Nginx default site cfg update + some deployment improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianSkierniewski committed May 5, 2017
1 parent 3a14758 commit d4b097e
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .server/nginx/site.conf
Expand Up @@ -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;
}

Expand Down
16 changes: 16 additions & 0 deletions 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"
7 changes: 7 additions & 0 deletions ansible/provision.yml
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions ansible/templates/production-compose.yml
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions ansible/templates/staging-compose.yml
Expand Up @@ -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"
Expand Down

0 comments on commit d4b097e

Please sign in to comment.