Skip to content
This repository has been archived by the owner on Apr 8, 2019. It is now read-only.

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
tarekziade committed Feb 8, 2017
1 parent 2069349 commit f77c0ac
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 12 deletions.
8 changes: 4 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ RUN rm -rf /var/lib/apt/lists/*
RUN addgroup --gid 10001 app
RUN adduser --gid 10001 --uid 10001 --home /app --shell /sbin/nologin --no-create-home --disabled-password --gecos we,dont,care,yeah app


ADD . /app
COPY requirements.txt /app/requirements.txt
RUN pip install -r requirements.txt

RUN echo "daemon off;" >> /etc/nginx/nginx.conf
COPY nginx.conf /etc/nginx/sites-available/default
COPY supervisor.conf /etc/supervisor/conf.d/
COPY global-nginx.conf /etc/nginx/nginx.conf

COPY supervisor.conf /etc/supervisor/conf.d/

ADD . /app
EXPOSE 80
CMD supervisord -n
28 changes: 28 additions & 0 deletions docker/global-nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
user app;
worker_processes 4;
pid /run/nginx.pid;

events {
worker_connections 768;
}

http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}


daemon off;
7 changes: 4 additions & 3 deletions docker/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@

upstream flask {
server unix:/app/servicebook.sock;
#server unix:/app/servicebook.sock;
server 127.0.0.1:5000;
}


server {
listen 80 default_server;
server_name .example.com;
charset utf-8;
client_max_body_size 75M;
client_max_body_size 75M;

location / {
uwsgi_pass flask;
Expand Down
3 changes: 3 additions & 0 deletions docker/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
flask
git+https://github.com/mozilla/servicebook-web.git#egg=serviceweb
git+https://github.com/tarekziade/restjson.git#egg=restjson
git+https://github.com/tarekziade/smwogger#egg=smwogger
git+https://github.com/mozilla/servicebook.git#egg=servicebook
git+https://github.com/jfinkels/flask-restless.git#egg=flask-restless
git+https://github.com/tarekziade/flask-restless-swagger.git#egg=flask-restless-swagger
Expand Down
12 changes: 7 additions & 5 deletions docker/uwsgi.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
[uwsgi]
debug = true
uid =10001
uid = 10001
gid = 10001
master = true
processes = 5
http = 127.0.0.1:5000
socket = /app/servicebook.sock
chmod-socket = 660
chown-socket = 10001:10001
http-socket = :5000
#socket = /app/servicebook.sock
#chmod-socket = 660
#chown-socket = app:app
vacuum = true
module = wsgiapp
logto = /app/uwsgi.log
logto2 = /app/uwsgi2.log

0 comments on commit f77c0ac

Please sign in to comment.