mirror of
https://github.com/fspc/workstand.git
synced 2026-09-16 16:41:38 -04:00
Changes for automatically starting dev server.
This commit is contained in:
@@ -9,6 +9,8 @@ venv: /opt/venv/{{ app_name }}-{{ group_names[0] }}
|
||||
|
||||
db_name: "{{ app_name }}_development"
|
||||
db_user: "{{ app_name }}"
|
||||
app_port: 8475
|
||||
|
||||
db_user_password: "{{ secret_db_user_password }}"
|
||||
secret_db_user_password: password
|
||||
app_domain_name: bikeshop.local
|
||||
@@ -0,0 +1,33 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name www.{{ app_domain_name }};
|
||||
# $scheme will get the http protocol
|
||||
# and 301 is best practice for tablet, phone, desktop and seo
|
||||
return 301 http://{{ app_domain_name }}$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name {{ app_domain_name }};
|
||||
|
||||
# location = /favicon.ico { access_log off; log_not_found off; }
|
||||
# location /static/ {
|
||||
# root {{ app_dir }};
|
||||
# }
|
||||
|
||||
# location /media/ {
|
||||
# root {{ app_dir }};
|
||||
# }
|
||||
|
||||
location / {
|
||||
proxy_pass_header Server;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_redirect off;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Scheme $scheme;
|
||||
proxy_connect_timeout 10;
|
||||
proxy_read_timeout 10;
|
||||
proxy_pass http://localhost:{{ app_port }}/;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
[group:{{ app_name }}]
|
||||
programs=django
|
||||
[program:django]
|
||||
command={{ venv }}/bin/gunicorn -b 127.0.0.1:{{ app_port }} --reload {{ app_name }}.wsgi:application
|
||||
directory={{ app_dir }}
|
||||
environment=DJANGO_SETTINGS_MODULE="{{ settings_module }}"
|
||||
autostart=true
|
||||
autorestart=true
|
||||
redirect_stderr=true
|
||||
user=vagrant
|
||||
+3
-2
@@ -7,6 +7,8 @@
|
||||
- zenoamaro.postgresql
|
||||
- python
|
||||
- database
|
||||
- supervisor
|
||||
- nginx
|
||||
- app
|
||||
|
||||
- name: Deployment tasks
|
||||
@@ -14,5 +16,4 @@
|
||||
remote_user: root
|
||||
roles:
|
||||
- deploy-code
|
||||
- supervisor
|
||||
- nginx
|
||||
|
||||
|
||||
Reference in New Issue
Block a user