File tree Expand file tree Collapse file tree 5 files changed +109
-25
lines changed Expand file tree Collapse file tree 5 files changed +109
-25
lines changed Original file line number Diff line number Diff line change 1
- FROM alpine:3.17
1
+ FROM nginxinc/nginx-unprivileged:alpine3.21-perl
2
+ LABEL maintainer "Mike Smith <mike.smith@embl.de>"
3
+ ENV TZ="Europe/Berlin"
2
4
3
- RUN apk update \
4
- && apk add lighttpd bash \
5
- && rm -rf /var/cache/apk/*
5
+ COPY nginx.conf /etc/nginx/conf.d/default.conf
6
6
7
- COPY lighttpd.conf /etc/lighttpd/lighttpd.conf
8
-
9
- RUN mkdir -p /var/www/localhost/htdocs /var/shared
10
- WORKDIR /var/www/localhost/htdocs
7
+ WORKDIR /var/www/html
11
8
9
+ ADD images/favicon.tar.gz ./
12
10
COPY images images/
13
- RUN tar xzvf images/favicon.tar.gz
14
11
15
12
COPY css css/
16
-
17
13
COPY html/* ./
18
14
15
+ USER root
19
16
# # This is just a symlink.
20
17
# # The actual file is created on a shared PVC by the git updater job
21
18
RUN ln -s /var/shared/sitemap.txt sitemap.txt
22
19
RUN ln -s /var/shared/robots.txt robots.txt
20
+ USER nginx
23
21
24
- RUN touch /run/lighttpd.pid && chown -R 100:100 /run/lighttpd.pid
25
-
26
- USER lighttpd
27
-
28
- CMD ["lighttpd" , "-D" , "-f" , "/etc/lighttpd/lighttpd.conf" ]
22
+ EXPOSE 8080
Original file line number Diff line number Diff line change @@ -129,10 +129,7 @@ <h4>Why we collect data</h4>
129
129
< span class ="text-muted "> </ span >
130
130
</ div >
131
131
</ footer >
132
- < script
133
- src ="https://code.jquery.com/jquery-3.7.0.slim.min.js "
134
- integrity ="sha256-tG5mcZUtJsZvyKAxYLVXrmjKBVLd6VpVccqz/r4ypFE= "
135
- crossorigin ="anonymous "> </ script >
132
+ < script src ="https://code.jquery.com/jquery-3.7.0.slim.min.js " integrity ="sha256-tG5mcZUtJsZvyKAxYLVXrmjKBVLd6VpVccqz/r4ypFE= " crossorigin ="anonymous "> </ script >
136
133
< script src ="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js " integrity ="sha512-ubuT8Z88WxezgSqf3RLuNi5lmjstiJcyezx34yIU2gAHonIi27Na7atqzUZCOoY4CExaoFumzOsFQ2Ch+I/HCw== " crossorigin ="anonymous " referrerpolicy ="no-referrer "> </ script >
137
134
< script src ="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.min.js " integrity ="sha384-+sLIOodYLS7CIrQpBjl+C7nPvqq+FbNUBDunl/OZv93DB7Ln/533i8e/mZXLi/P+ " crossorigin ="anonymous "> </ script >
138
135
</ body >
Original file line number Diff line number Diff line change @@ -110,10 +110,7 @@ <h1 class="card-title">Code Search</h1>
110
110
< span class ="text-muted "> </ span >
111
111
</ div >
112
112
</ footer >
113
- < script
114
- src ="https://code.jquery.com/jquery-3.7.0.slim.min.js "
115
- integrity ="sha256-tG5mcZUtJsZvyKAxYLVXrmjKBVLd6VpVccqz/r4ypFE= "
116
- crossorigin ="anonymous "> </ script >
113
+ < script src ="https://code.jquery.com/jquery-3.7.0.slim.min.js " integrity ="sha256-tG5mcZUtJsZvyKAxYLVXrmjKBVLd6VpVccqz/r4ypFE= " crossorigin ="anonymous "> </ script >
117
114
< script src ="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js " integrity ="sha512-ubuT8Z88WxezgSqf3RLuNi5lmjstiJcyezx34yIU2gAHonIi27Na7atqzUZCOoY4CExaoFumzOsFQ2Ch+I/HCw== " crossorigin ="anonymous " referrerpolicy ="no-referrer "> </ script >
118
115
< script src ="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.min.js " integrity ="sha384-+sLIOodYLS7CIrQpBjl+C7nPvqq+FbNUBDunl/OZv93DB7Ln/533i8e/mZXLi/P+ " crossorigin ="anonymous "> </ script >
119
116
</ body >
Original file line number Diff line number Diff line change
1
+ geo $blocked_ips {
2
+ 104.206.97.90 1 ; # add as many single IPs
3
+ default 0; # everybody else
4
+ }
5
+
6
+ server {
7
+ listen 8080 default ;
8
+
9
+ root /var/www/html;
10
+ access_log /var/log/nginx/access_home.log;
11
+ error_log /var/log/nginx/error_home.log;
12
+ set $fpm_backend 127.0.0.1 ;
13
+
14
+ location / {
15
+ index index.html;
16
+ }
17
+
18
+ # Basic configuration
19
+ expires off ;
20
+ server_tokens off ;
21
+ client_max_body_size 4m ;
22
+ keepalive_timeout 20s ;
23
+ sendfile on ;
24
+ tcp_nopush on ;
25
+
26
+ # Forwarding EMBL ingress IP addresses to the access logs
27
+ set_real_ip_from 10.133.0.0 /16 ;
28
+ real_ip_header X-Forwarded-For;
29
+ real_ip_recursive on ;
30
+
31
+ # Security
32
+ add_header X-Frame-Options "SAMEORIGIN" always;
33
+ add_header X-XSS-Protection "1; mode=block" always;
34
+ add_header X-Content-Type-Options nosniff always;
35
+ add_header Referrer-Policy "no-referrer-when-downgrade" always;
36
+
37
+ # Performance
38
+ gzip on ;
39
+ gzip_comp_level 5 ;
40
+ gzip_min_length 256 ;
41
+ gzip_proxied any;
42
+ gzip_vary on ;
43
+ gzip_types
44
+ application/atom+xml
45
+ application/javascript
46
+ application/json
47
+ application/ld+json
48
+ application/manifest+json
49
+ application/rss+xml
50
+ application/geo+json
51
+ application/vnd.ms-fontobject
52
+ application/x-web-app-manifest+json
53
+ application/xhtml+xml
54
+ application/xml
55
+ application/rdf+xml
56
+ font/otf
57
+ application/wasm
58
+ image/bmp
59
+ image/svg+xml
60
+ text/cache-manifest
61
+ text/css
62
+ text/javascript
63
+ text/plain
64
+ text/markdown
65
+ text/vcard
66
+ text/calendar
67
+ text/vnd.rim.location.xloc
68
+ text/vtt
69
+ text/x-component
70
+ text/x-cross-domain-policy;
71
+
72
+ # Content types
73
+ include mime.types;
74
+ charset utf-8;
75
+ charset_types
76
+ text/css
77
+ text/plain
78
+ text/vnd.wap.wml
79
+ text/javascript
80
+ text/markdown
81
+ text/calendar
82
+ text/x-component
83
+ text/vcard
84
+ text/cache-manifest
85
+ text/vtt
86
+ application/json
87
+ application/manifest+json;
88
+ }
Original file line number Diff line number Diff line change @@ -229,13 +229,17 @@ spec:
229
229
labels :
230
230
app : code-home
231
231
spec :
232
+ securityContext :
233
+ fsGroup : 101
232
234
containers :
233
235
- name : code-home
234
- image : grimbough/code.bioc-home:0.1.5
236
+ image : grimbough/code.bioc-home:0.2.0
235
237
imagePullPolicy : " Always"
236
238
volumeMounts :
237
239
- mountPath : " /var/shared"
238
240
name : git-repo-shared-info
241
+ - mountPath : " /var/log/nginx"
242
+ name : nginx-logs
239
243
ports :
240
244
- name : http
241
245
containerPort : 8080
@@ -251,7 +255,8 @@ spec:
251
255
runAsNonRoot : true
252
256
seccompProfile :
253
257
type : RuntimeDefault
254
- runAsUser : 100 # lighttpd uid
258
+ runAsUser : 101
259
+ runAsGroup : 101
255
260
allowPrivilegeEscalation : false
256
261
capabilities :
257
262
drop :
@@ -261,3 +266,6 @@ spec:
261
266
persistentVolumeClaim :
262
267
claimName : bioc-code-tools-shared-info-pvc
263
268
readOnly : true
269
+ - name : nginx-logs
270
+ persistentVolumeClaim :
271
+ claimName : nginx-logs
You can’t perform that action at this time.
0 commit comments