build & deploy with docker
13
Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Compile the hugo site
|
||||||
|
FROM ubuntu:latest AS builder
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y hugo
|
||||||
|
|
||||||
|
COPY ./hugo /app
|
||||||
|
RUN hugo -s /app
|
||||||
|
|
||||||
|
# Setup deployment
|
||||||
|
FROM nginx:alpine AS final
|
||||||
|
|
||||||
|
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
COPY --from=0 /var/www/rezepte /var/www
|
||||||
BIN
hugo/.DS_Store
vendored
Normal file
BIN
hugo/assets/.DS_Store
vendored
Normal file
BIN
hugo/layouts/.DS_Store
vendored
Normal file
BIN
hugo/static/.DS_Store
vendored
Normal file
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 246 KiB After Width: | Height: | Size: 246 KiB |
BIN
hugo/themes/.DS_Store
vendored
Normal file
43
nginx/nginx.conf
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
# nginx.conf
|
||||||
|
worker_processes auto;
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
# Logging
|
||||||
|
access_log /var/log/nginx/access.log;
|
||||||
|
error_log /var/log/nginx/error.log;
|
||||||
|
|
||||||
|
# Gzip compression
|
||||||
|
gzip on;
|
||||||
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
||||||
|
gzip_min_length 256;
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name example.com;
|
||||||
|
|
||||||
|
root /var/www/;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
# Error pages
|
||||||
|
#error_page 404 /404.html;
|
||||||
|
#location = /404.html {
|
||||||
|
# internal;
|
||||||
|
#}
|
||||||
|
|
||||||
|
# Serve static files
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ =404;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Optional: Caching for static assets
|
||||||
|
location ~* \.(?:ico|css|js|gif|jpe?g|png|svg|woff2?|ttf|otf|eot|html|xml|json)$ {
|
||||||
|
expires 10M;
|
||||||
|
access_log off;
|
||||||
|
add_header Cache-Control "public";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||