diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/Dockerfile b/Dockerfile index 7519f47..bbdbbd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +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 +FROM klakegg/hugo:ext-alpine AS builder +WORKDIR /app +COPY ./hugo . +RUN hugo --minify --destination /output # Setup deployment -FROM nginx:alpine AS final - -COPY ./nginx/nginx.conf /etc/nginx/nginx.conf -COPY --from=0 /var/www/rezepte /var/www +FROM alpine:latest +WORKDIR /www +COPY --from=builder /output /www +RUN apk add --no-cache busybox-extras +EXPOSE 80 +CMD ["httpd", "-f", "-p", "80", "-h", "/www"] diff --git a/hugo/.DS_Store b/hugo/.DS_Store deleted file mode 100644 index 51821cc..0000000 Binary files a/hugo/.DS_Store and /dev/null differ diff --git a/.hugo_build.lock b/hugo/.hugo_build.lock similarity index 100% rename from .hugo_build.lock rename to hugo/.hugo_build.lock diff --git a/hugo/assets/.DS_Store b/hugo/assets/.DS_Store deleted file mode 100644 index ab22786..0000000 Binary files a/hugo/assets/.DS_Store and /dev/null differ diff --git a/hugo/layouts/.DS_Store b/hugo/layouts/.DS_Store deleted file mode 100644 index 4594a11..0000000 Binary files a/hugo/layouts/.DS_Store and /dev/null differ diff --git a/hugo/static/.DS_Store b/hugo/static/.DS_Store deleted file mode 100644 index 7c294e9..0000000 Binary files a/hugo/static/.DS_Store and /dev/null differ diff --git a/nginx/nginx.conf b/nginx/nginx.conf deleted file mode 100644 index 3c327bd..0000000 --- a/nginx/nginx.conf +++ /dev/null @@ -1,43 +0,0 @@ -# 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"; - } - } -}