Skip to content

Commit

Permalink
Update docker flow to use nginx instead of jekyll serve
Browse files Browse the repository at this point in the history
  • Loading branch information
zquestz committed Sep 24, 2017
1 parent 99a3a2d commit 65b1354
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 10 deletions.
13 changes: 3 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
FROM ruby:2.3.5

COPY . /acceptbitcoin
WORKDIR /acceptbitcoin

RUN bundle install

EXPOSE 4000

CMD [ "jekyll", "serve", "-H", "0.0.0.0"]
FROM nginx
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY _site/ /usr/share/nginx/html/
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ acceptBitcoin.cash also includes a Docker image for easy deployment. You can bui

```
cd ~/acceptbitcoincash
gem install bundler
bundle exec jekyll build
docker build -t acceptbitcoincash .
docker run -p 4000:4000 acceptbitcoincash
```
Expand Down
32 changes: 32 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
server {
listen 80;
server_name acceptbitcoin.cash;

if ( $http_x_forwarded_proto = 'http' ) {
return 301 https://$host$request_uri;
}

root /usr/share/nginx/html;

location / {
index index.html;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

## Compression.
gzip on;
gzip_buffers 16 8k;
gzip_comp_level 1;
gzip_http_version 1.1;
gzip_min_length 10;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/x-icon application/vnd.ms-fontobject font/opentype application/x-font-ttf;
gzip_vary on;
gzip_proxied any; # Compression for all requests.
## No need for regexps. See
## http://wiki.nginx.org/NginxHttpGzipModule#gzip_disable
gzip_disable msie6;

0 comments on commit 65b1354

Please sign in to comment.