Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dtu-enote
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
enote
dtu-enote
Commits
f1ff2c22
Commit
f1ff2c22
authored
6 years ago
by
iaibrys
Browse files
Options
Downloads
Patches
Plain Diff
Add Brotli compression
parent
eef95fba
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Dockerfile
+2
-1
2 additions, 1 deletion
Dockerfile
erb/default.conf.erb
+16
-7
16 additions, 7 deletions
erb/default.conf.erb
lib/tasks/build.rake
+37
-21
37 additions, 21 deletions
lib/tasks/build.rake
with
55 additions
and
29 deletions
Dockerfile
+
2
−
1
View file @
f1ff2c22
FROM
nginx:alpine
#FROM nginx:alpine
FROM
fholzer/nginx-brotli
# We will map these using volumes
RUN
rm
/etc/nginx/nginx.conf
...
...
This diff is collapsed.
Click to expand it.
erb/default.conf.erb
+
16
−
7
View file @
f1ff2c22
...
...
@@ -478,19 +478,28 @@ server {
<%
end
%>
location / {
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 1;
gzip_proxied any;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/javascript;
location /MathJax {
rewrite ^/MathJax/(.*)$ /vendor/MathJax/$1;
}
location ~ ^/(assets|images|vendor|font|fonts)/ {
location ~ ^/(assets|images|vendor|font|fonts|packs)/ {
brotli on;
brotli_types text/plain text/css application/json application/javascript application/x-javascript text/javascript;
brotli_comp_level 1;
gzip_comp_level 6;
gzip_static on;
brotli_static on;
add_header Cache-Control public;
expires 4w;
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_disable "MSIE [1-6]\.";
gzip_comp_level 6;
gzip_types application/x-javascript text/css image/x-icon image/png image/jpeg image/gif;
add_header proxy_served_static gzip;
break;
}
...
...
This diff is collapsed.
Click to expand it.
lib/tasks/build.rake
+
37
−
21
View file @
f1ff2c22
...
...
@@ -3,6 +3,7 @@ require 'yaml'
require
'set'
require
'awesome_print'
require
'colorize'
require
'open3'
namespace
:build
do
...
...
@@ -172,17 +173,32 @@ namespace :build do
private
def
log_and_run
(
cmd
)
logger
.
debug
cmd
logger
.
debug
`
#{
cmd
}
`
return
$?
logger
.
debug
"Executing
#{
cmd
}
"
wait_thr_value
=
Open3
.
popen2e
(
cmd
)
do
|
stdin
,
stdout_stderr
,
wait_thread
|
Thread
.
new
do
stdout_stderr
.
each
{
|
l
|
puts
l
}
end
stdin
.
close
wait_thread
.
value
end
if
wait_thr_value
.
success?
logger
.
info
"
#{
cmd
}
: Success!"
.
green
else
logger
.
info
"
#{
cmd
}
: Failed!"
.
red
end
wait_thr_value
.
exitstatus
end
def
run_cmd
(
cmd
,
fail_message
=
nil
)
out
=
`
#{
cmd
}
`
logger
.
info
out
if
$?
!=
0
rv
=
log_and_run
cmd
if
rv
!=
0
if
fail_message
!=
nil
logger
.
error
"
#{
cmd
}
failed with
#{
out
}
:
#{
fail_message
}
"
logger
.
error
"
#{
cmd
}
failed with
#{
rv
}
:
#{
fail_message
}
"
fail
fail_message
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment