mirror of
https://github.com/darkwire/darkwire.io.git
synced 2025-07-18 10:49:02 +00:00
Add EB config
This commit is contained in:
parent
e5bdcd07d4
commit
a4854209db
3
.ebextensions/node-settings.config
Normal file
3
.ebextensions/node-settings.config
Normal file
@ -0,0 +1,3 @@
|
||||
option_settings:
|
||||
aws:elasticbeanstalk:container:nodejs:
|
||||
NodeCommand: "npm run-script prod"
|
66
.ebextensions/proxy.config
Normal file
66
.ebextensions/proxy.config
Normal file
@ -0,0 +1,66 @@
|
||||
files:
|
||||
/etc/nginx/conf.d/proxy.conf:
|
||||
mode: "000644"
|
||||
owner: root
|
||||
group: root
|
||||
content: |
|
||||
upstream nodejs {
|
||||
server 127.0.0.1:8081;
|
||||
keepalive 256;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 8080;
|
||||
|
||||
if ($time_iso8601 ~ "^(\d{4})-(\d{2})-(\d{2})T(\d{2})") {
|
||||
set $year $1;
|
||||
set $month $2;
|
||||
set $day $3;
|
||||
set $hour $4;
|
||||
}
|
||||
access_log /var/log/nginx/healthd/application.log.$year-$month-$day-$hour healthd;
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
location /socket.io/ {
|
||||
proxy_pass http://nodejs;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://nodejs;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
gzip on;
|
||||
gzip_comp_level 4;
|
||||
gzip_types text/html text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
||||
|
||||
location /static {
|
||||
alias /var/app/current/static;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/opt/elasticbeanstalk/hooks/configdeploy/post/99_kill_default_nginx.sh:
|
||||
mode: "000755"
|
||||
owner: root
|
||||
group: root
|
||||
content: |
|
||||
#!/bin/bash -xe
|
||||
rm -f /etc/nginx/conf.d/00_elastic_beanstalk_proxy.conf
|
||||
service nginx stop
|
||||
service nginx start
|
||||
|
||||
container_commands:
|
||||
removeconfig:
|
||||
command: "rm -f /tmp/deployment/config/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf /etc/nginx/conf.d/00_elastic_beanstalk_proxy.conf"
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -3,3 +3,8 @@ node_modules
|
||||
npm-debug.log
|
||||
src/public/main.js
|
||||
src/.secret
|
||||
|
||||
# Elastic Beanstalk Files
|
||||
.elasticbeanstalk/*
|
||||
!.elasticbeanstalk/*.cfg.yml
|
||||
!.elasticbeanstalk/*.global.yml
|
||||
|
@ -50,7 +50,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"start": "node index.js",
|
||||
"prod": "npm run bundle && forever start -c \"npm start\" ./",
|
||||
"prod": "npm run bundle && npm run start",
|
||||
"dev": "npm run bundle && gulp start",
|
||||
"bundle": "gulp bundle",
|
||||
"test": "npm run bundle && gulp test",
|
||||
|
Loading…
x
Reference in New Issue
Block a user