forked from LibreSchool/libreschool.org
docker image support
This commit is contained in:
parent
14c54c1383
commit
042c206885
3
.dockerignore
Normal file
3
.dockerignore
Normal file
@ -0,0 +1,3 @@
|
||||
public/
|
||||
resources/
|
||||
.hugo_build.lock
|
33
Dockerfile
Normal file
33
Dockerfile
Normal file
@ -0,0 +1,33 @@
|
||||
FROM debian:stable-slim AS hugobuild
|
||||
|
||||
RUN \
|
||||
apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --assume-yes wget ca-certificates && \
|
||||
wget -O /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.120.4/hugo_extended_0.120.4_linux-amd64.deb && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --assume-yes /tmp/hugo.deb
|
||||
|
||||
COPY . /src
|
||||
|
||||
RUN \
|
||||
hugo -s /src --gc --minify
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
RUN \
|
||||
apk -U upgrade && \
|
||||
apk add nginx curl && \
|
||||
mkdir -p /wwwroot /logs
|
||||
|
||||
COPY docker/rootfs /
|
||||
COPY --from=hugobuild /src/public /wwwroot/
|
||||
|
||||
RUN \
|
||||
chown -R nginx:www-data /wwwroot /logs && \
|
||||
chmod -R a-x,a=rX,ug+w /wwwroot /logs
|
||||
|
||||
# config test
|
||||
RUN nginx -t
|
||||
|
||||
HEALTHCHECK --timeout=10s CMD curl --silent --fail -o /dev/null http://127.0.0.1:80/
|
||||
|
||||
ENTRYPOINT [ "/usr/sbin/nginx" ]
|
1
docker/rootfs/etc/nginx/conf.d/nodaemon.conf
Normal file
1
docker/rootfs/etc/nginx/conf.d/nodaemon.conf
Normal file
@ -0,0 +1 @@
|
||||
daemon off;
|
22
docker/rootfs/etc/nginx/http.d/default.conf
Normal file
22
docker/rootfs/etc/nginx/http.d/default.conf
Normal file
@ -0,0 +1,22 @@
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
server_name _;
|
||||
access_log /logs/nginx.access.log main;
|
||||
sendfile off;
|
||||
root /wwwroot;
|
||||
index index.html;
|
||||
|
||||
location = /404.html {
|
||||
internal;
|
||||
}
|
||||
}
|
||||
|
||||
gzip on;
|
||||
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js image/x-icon font/woff2 font/woff application/x-font-woff;
|
||||
gzip_disable "msie6";
|
||||
|
||||
etag on;
|
||||
if_modified_since exact;
|
||||
add_header Pragma "public";
|
||||
add_header Cache-Control "max-age=31536000, public";
|
Loading…
x
Reference in New Issue
Block a user