Switched to thttpd-based Docker image
continuous-integration/drone the build failed
Details
continuous-integration/drone the build failed
Details
parent
31ee1dae7f
commit
a2aaaa81ec
|
@ -11,5 +11,5 @@
|
|||
!themes/
|
||||
!config.yaml
|
||||
|
||||
# Nginx config file
|
||||
!nginx.conf
|
||||
# thttpd config file
|
||||
!thttpd.conf
|
||||
|
|
40
Dockerfile
40
Dockerfile
|
@ -1,9 +1,25 @@
|
|||
# Global build argument
|
||||
ARG THTTPD_VER=2.29
|
||||
|
||||
FROM alpine:latest AS builder
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Install Hugo
|
||||
RUN apk add --no-cache hugo
|
||||
# =====BUILD thttpd=====
|
||||
WORKDIR /usr/src
|
||||
ARG THTTPD_VER
|
||||
|
||||
# Install dependencies & build thttpd
|
||||
RUN apk update && \
|
||||
apk add --no-cache curl hugo build-base && \
|
||||
curl -sSL "https://www.acme.com/software/thttpd/thttpd-$THTTPD_VER.tar.gz" | \
|
||||
tar xzf - && \
|
||||
cd "thttpd-$THTTPD_VER" && \
|
||||
./configure && \
|
||||
make
|
||||
|
||||
|
||||
# =====BUILD THE BLOG=====
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Copy site files for building
|
||||
COPY . ./
|
||||
|
@ -12,7 +28,19 @@ COPY . ./
|
|||
RUN hugo --minify
|
||||
|
||||
|
||||
FROM nginx:alpine
|
||||
# ====CREATE RELEASE IMAGE====
|
||||
FROM alpine:latest
|
||||
ARG THTTPD_VER
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
COPY --from=builder /usr/src/app/public /usr/share/nginx/html
|
||||
# Install dumb-init
|
||||
RUN apk update && \
|
||||
apk add --no-cache dumb-init
|
||||
|
||||
# Copy over binary & static files
|
||||
COPY --from=builder /usr/src/thttpd-$THTTPD_VER/thttpd /usr/local/bin/thttpd
|
||||
COPY --from=builder /usr/src/app/public /var/www/html
|
||||
COPY thttpd.conf /etc/thttpd.conf
|
||||
|
||||
|
||||
ENTRYPOINT [ "dumb-init", "--" ]
|
||||
CMD [ "/usr/local/bin/thttpd", "-D", "-C", "/etc/thttpd.conf" ]
|
||||
|
|
26
nginx.conf
26
nginx.conf
|
@ -1,26 +0,0 @@
|
|||
worker_processes 1;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
# https://stackoverflow.com/a/51360290/6483444
|
||||
map $sent_http_content_type $expires {
|
||||
default off;
|
||||
text/html epoch;
|
||||
text/css max;
|
||||
application/javascript max;
|
||||
~image/ max;
|
||||
}
|
||||
|
||||
server {
|
||||
server_name _;
|
||||
listen 80;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
include mime.types;
|
||||
expires $expires;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
port=8080
|
||||
dir=/var/www/html
|
Reference in New Issue