Skip to content

Commit 65b1354

Browse files
committed
Update docker flow to use nginx instead of jekyll serve
1 parent 99a3a2d commit 65b1354

File tree

3 files changed

+37
-10
lines changed

3 files changed

+37
-10
lines changed

Dockerfile

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
FROM ruby:2.3.5
2-
3-
COPY . /acceptbitcoin
4-
WORKDIR /acceptbitcoin
5-
6-
RUN bundle install
7-
8-
EXPOSE 4000
9-
10-
CMD [ "jekyll", "serve", "-H", "0.0.0.0"]
1+
FROM nginx
2+
COPY nginx.conf /etc/nginx/conf.d/default.conf
3+
COPY _site/ /usr/share/nginx/html/

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ acceptBitcoin.cash also includes a Docker image for easy deployment. You can bui
4545

4646
```
4747
cd ~/acceptbitcoincash
48+
gem install bundler
49+
bundle exec jekyll build
4850
docker build -t acceptbitcoincash .
4951
docker run -p 4000:4000 acceptbitcoincash
5052
```

nginx.conf

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
server {
2+
listen 80;
3+
server_name acceptbitcoin.cash;
4+
5+
if ( $http_x_forwarded_proto = 'http' ) {
6+
return 301 https://$host$request_uri;
7+
}
8+
9+
root /usr/share/nginx/html;
10+
11+
location / {
12+
index index.html;
13+
}
14+
15+
error_page 500 502 503 504 /50x.html;
16+
location = /50x.html {
17+
root /usr/share/nginx/html;
18+
}
19+
}
20+
21+
## Compression.
22+
gzip on;
23+
gzip_buffers 16 8k;
24+
gzip_comp_level 1;
25+
gzip_http_version 1.1;
26+
gzip_min_length 10;
27+
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;
28+
gzip_vary on;
29+
gzip_proxied any; # Compression for all requests.
30+
## No need for regexps. See
31+
## http://wiki.nginx.org/NginxHttpGzipModule#gzip_disable
32+
gzip_disable msie6;

0 commit comments

Comments
 (0)