Commit b91faf2 1 parent 2dcfd3f commit b91faf2 Copy full SHA for b91faf2
File tree 6 files changed +57
-27
lines changed
6 files changed +57
-27
lines changed Original file line number Diff line number Diff line change @@ -58,15 +58,20 @@ RUN yum install tar -y
58
58
# install nginx
59
59
RUN yum install nginx -y
60
60
61
+ RUN setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx
62
+
61
63
# chown nginx directories
62
64
RUN chown -R gen3:gen3 /var/log/nginx
63
65
64
- # copy nginx config
65
- COPY ./deployment/nginx/ nginx.conf /etc/nginx/ nginx.conf
66
+ # pipe nginx logs to stdout and stderr
67
+ RUN ln -sf /dev/stdout /var/log/ nginx/access.log && ln -sf /dev/stderr /var/log/ nginx/error.log
66
68
69
+ # create /var/lib/nginx/tmp/client_body to allow nginx to write to fence
70
+ RUN mkdir -p /var/lib/nginx/tmp/client_body
71
+ RUN chown -R gen3:gen3 /var/lib/nginx/
67
72
68
- RUN mkdir -p /var/tmp/uwsgi_flask_metrics
69
- RUN chown -R gen3:gen3 /var/tmp/uwsgi_flask_metrics
73
+ # copy nginx config
74
+ COPY ./deployment/nginx/nginx.conf /etc/nginx/nginx.conf
70
75
71
76
72
77
# Switch to non-root user 'gen3' for the serving process
@@ -77,6 +82,5 @@ RUN source /venv/bin/activate
77
82
ENV PYTHONUNBUFFERED=1 \
78
83
PYTHONIOENCODING=UTF-8
79
84
80
- # run nginx and gunicorn
81
- COPY ./deployment/scripts/dockerrun.sh /deployment/scripts/dockerrun.sh
82
- CMD ["/deployment/scripts/dockerrun.sh" ]
85
+
86
+ CMD ["/fence/dockerrun.bash" ]
Original file line number Diff line number Diff line change 1
- # reverse proxy for fence
2
- upstream fence {
3
- server localhost:8000;
1
+ user gen3;
2
+ worker_processes auto;
3
+ error_log /var/log/nginx/error.log notice ;
4
+ pid /var/lib/nginx/nginx.pid;
5
+
6
+ # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
7
+ include /usr/share/nginx/modules/*.conf;
8
+
9
+ events {
10
+ worker_connections 1024 ;
4
11
}
5
12
6
- server {
7
- listen 80 ;
8
- server_name localhost;
13
+ http {
14
+ log_format main '$remote_addr - $remote_user [$time_local ] "$request " '
15
+ '$status $body_bytes_sent "$http_referer " '
16
+ '"$http_user_agent " "$http_x_forwarded_for "' ;
17
+
18
+ access_log /var/log/nginx/access.log main ;
19
+
20
+ sendfile on ;
21
+ tcp_nopush on ;
22
+ keepalive_timeout 65 ;
23
+ types_hash_max_size 4096 ;
24
+
25
+ include /etc/nginx/mime.types;
26
+ default_type application/octet-stream;
27
+
28
+ # Load modular configuration files from the /etc/nginx/conf.d directory.
29
+ # See http://nginx.org/en/docs/ngx_core_module.html#include
30
+ # for more information.
31
+ include /etc/nginx/conf.d/*.conf;
32
+
33
+ server {
34
+
35
+ listen 80 ;
36
+ server_name localhost;
9
37
10
- location / {
11
- proxy_pass http://fence;
12
- proxy_set_header Host $host ;
13
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
38
+ location / {
39
+ proxy_pass http://localhost:8000;
40
+ proxy_set_header Host $host ;
41
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
42
+ }
14
43
}
15
44
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -19,5 +19,5 @@ if [ -f /fence/jwt-keys.tar ]; then
19
19
fi
20
20
)
21
21
fi
22
-
22
+ nginx
23
23
gunicorn -c /fence/deployment/wsgi/gunicorn.conf.py
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ markdown = "^3.1.1"
39
39
markupsafe = " ^2.0.1"
40
40
41
41
paramiko = " >=2.6.0"
42
- prometheus-client = " <1 "
42
+ prometheus-client = " >=0.20.0 "
43
43
psycopg2-binary = " ^2.8.3"
44
44
PyJWT = " ^2.4.0"
45
45
python_dateutil = " ^2.6.1"
You can’t perform that action at this time.
0 commit comments