Skip to content

Commit

Permalink
Initial container setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ApsOps committed May 19, 2016
1 parent ea63059 commit 7384d35
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM nginx

ENV SOCKET_SERVER socket_server
COPY nginx.conf /etc/nginx/nginx.conf
COPY run.sh /

CMD ["bash", "/run.sh"]
41 changes: 41 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
user nginx;
worker_processes 1;
daemon off;

error_log stderr warn;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format elb_log '$proxy_protocol_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent "$http_referer" '
'"$http_user_agent"';

access_log /dev/stdout elb_log;

server {
listen 80;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;

location / {
proxy_pass http://SOCKET_SERVER;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_cache_bypass $http_upgrade;
}
}

sendfile on;
keepalive_timeout 65;
include /etc/nginx/conf.d/*.conf;
}
4 changes: 4 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

sed -i "s/SOCKET_SERVER/${SOCKET_SERVER}/g" /etc/nginx/nginx.conf
nginx

0 comments on commit 7384d35

Please sign in to comment.