created basic docker configs

This commit is contained in:
2025-06-01 20:15:07 +02:00
parent 4b19eab8e2
commit 6c1d484775
4 changed files with 48 additions and 0 deletions

12
Dockerfile Normal file
View File

@@ -0,0 +1,12 @@
FROM docker.io/hugomods/hugo:debian-exts AS builder
WORKDIR /src
COPY . .
RUN hugo --minify
FROM docker.io/nginx:alpine
COPY --from=builder /src/public /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80

16
docker-compose.prod.yml Normal file
View File

@@ -0,0 +1,16 @@
version: '3'
services:
blog:
build: .
restart: always
networks:
- web
labels:
- "traefik.enable=true"
- "traefik.http.routers.blog.rule=Host(`blog.yourdomain.com`)"
- "traefik.http.routers.blog.entrypoints=websecure"
- "traefik.http.routers.blog.tls.certresolver=myresolver"
networks:
web:
external: true

10
docker-compose.yml Normal file
View File

@@ -0,0 +1,10 @@
version: '3'
services:
hugo:
image: docker.io/hugomods/hugo:debian-exts
command: server -D --bind 0.0.0.0
volumes:
- .:/src
ports:
- "1313:1313"

10
nginx.conf Normal file
View File

@@ -0,0 +1,10 @@
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
location / {
index index.html;
try_files $uri $uri/ =404;
}
}