diff --git a/tobias-website.yaml b/tobias-website.yaml new file mode 100644 index 0000000..a6949db --- /dev/null +++ b/tobias-website.yaml @@ -0,0 +1,28 @@ +version: '1.1' + +networks: + frontend: + external: true + +services: + website: + image: nginx:latest + restart: always + volumes: + - '/hdd/tobias-website/public:/usr/share/nginx/html:ro' + networks: + - frontend + + updater: + # Build the image from your Dockerfile.updater + image: alpine-hugo + restart: unless-stopped + volumes: + # Mount the same volume as Nginx so the updater can write to it + - '/hdd/tobias-website:/app' + # You might also want to mount your script if you want to edit it without rebuilding the image + # - ./your_update_script.sh:/app/your_update_script.sh:ro + command: sh -c "cd /app; while true; do /app/build_website.sh; sleep 3600; done" # Run every hour (3600 seconds) + # If your update script needs to connect to the internet (e.g., for git clone, API calls), + # it needs network access, which is usually provided by default by Docker Compose's bridge network. + # If it needs to interact with your Nginx or other services, they'll be on the same default network.