Skip to content

Commit

Permalink
Use hugo 0.110.0. (#33)
Browse files Browse the repository at this point in the history
* Use hugo 0.110.0.

Nothing much included in recent versions, mostly bug-fixes and build/CI improvements. The binary name has changed so thats updated in our Dockerfile.

* build: Docker cleanup/update.

- Use Alpine version of nginx image (23MB instead of 142MB)
- Fix MIME type for rss feeds.
- Clean up .gitignore and .dockerignore.
- Ensure scripts fail on error.
  • Loading branch information
jholdstock committed Mar 24, 2023
1 parent e1ede8a commit d5e9271
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 21 deletions.
11 changes: 11 additions & 0 deletions .dockerignore
@@ -0,0 +1,11 @@
.gitignore
.git
.github
LICENSE
README.md

bin/build.sh
bin/watch.sh
src/public
src/resources
src/.hugo_build.lock
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Expand Up @@ -5,6 +5,6 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Build
run: docker build -t decred/dexweb:$(date +%s) .
4 changes: 2 additions & 2 deletions .gitignore
@@ -1,4 +1,4 @@
dist/
src/resources/_gen
src/resources
src/public
.hugo_build.lock
src/.hugo_build.lock
10 changes: 5 additions & 5 deletions Dockerfile
@@ -1,7 +1,7 @@
# builder image
# Build image
FROM alpine:latest

ENV HUGO_VERSION 0.94.2
ENV HUGO_VERSION 0.110.0

LABEL description="gohugo build"
LABEL version="1.0"
Expand All @@ -11,8 +11,8 @@ WORKDIR /tmp

RUN apk update && apk upgrade
RUN apk add --no-cache bash wget libc6-compat g++
RUN wget -q https://github.com/gohugoio/hugo/releases/download/v$HUGO_VERSION/hugo_extended_"$HUGO_VERSION"_Linux-64bit.tar.gz
RUN tar xz -C /usr/local/bin -f hugo_extended_"$HUGO_VERSION"_Linux-64bit.tar.gz
RUN wget -q https://github.com/gohugoio/hugo/releases/download/v$HUGO_VERSION/hugo_extended_"$HUGO_VERSION"_linux-amd64.tar.gz
RUN tar xz -C /usr/local/bin -f hugo_extended_"$HUGO_VERSION"_linux-amd64.tar.gz

WORKDIR /root

Expand All @@ -25,7 +25,7 @@ RUN rm -rf public resources
RUN hugo --buildFuture

# Serve image (stable nginx version)
FROM nginx:1.20
FROM nginx:1.22-alpine

LABEL description="dexweb server"
LABEL version="1.0"
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
ISC License

Copyright (c) 2020-2022 The Decred developers
Copyright (c) 2020-2023 The Decred developers

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand Down
14 changes: 11 additions & 3 deletions bin/build.sh
@@ -1,19 +1,27 @@
#!/bin/bash -e
#!/usr/bin/env bash
# Requires docker 17.05 or higher

set -e

echo ""
echo "================================="
echo " Building dexweb docker image "
echo "================================="
echo ""

docker build -t decred/dexweb .
IMAGE_NAME=decred/dexweb

if [ "$1" != "" ]; then
IMAGE_NAME=$1
fi

docker build -t $IMAGE_NAME .

echo ""
echo "==================="
echo " Build complete"
echo "==================="
echo ""
echo "You can now run dexweb with the following command:"
echo " docker run -d --rm -p <local port>:80 decred/dexweb:latest"
echo " docker run -d --rm -p <local port>:80 $IMAGE_NAME:latest"
echo ""
2 changes: 2 additions & 0 deletions bin/watch.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

set -e

# Remove old hugo output before building
rm -rf src/public src/resources

Expand Down
17 changes: 9 additions & 8 deletions conf/nginx.conf
Expand Up @@ -2,16 +2,17 @@ server {
listen 80;
server_name localhost;

#Hide Version
charset utf-8;

# Hide Version
server_tokens off;

#Security Headers
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "no-referrer" always;
# Security Headers
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "no-referrer" always;

#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;

location / {
Expand All @@ -27,6 +28,6 @@ server {
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/rss+xml text/javascript;
}

2 changes: 1 addition & 1 deletion src/layouts/partials/footer.html
Expand Up @@ -130,7 +130,7 @@ <h1>Join the Community</h1>
<div class="container h-100">
<div class="row h-100 d-flex align-items-center">
<div class="col-12 col-lg-6 bold">
© 2020-2022 Decred Developers, All Rights Reserved.
© 2020-2023 Decred Developers, All Rights Reserved.
</div>
<div class="col-12 col-lg-6 text-lg-right">
DCRDEX development is funded by
Expand Down

0 comments on commit d5e9271

Please sign in to comment.