diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9632edb --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.git +.gitignore +.vscode +Dockerfile +.dockerignore +README.md +build-and-push.ps1 diff --git a/Dockerfile b/Dockerfile index b7c003b..f2fb846 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,14 @@ FROM nginx:alpine +LABEL org.opencontainers.image.source="reg.maximuss.dk/dkb-banners" \ + org.opencontainers.image.title="dkb-banners" + # Fjern default nginx side RUN rm -rf /usr/share/nginx/html/* -# Kopiér dine filer ind +# Kopiér site-filer ind (Dockerfile, .git m.m. filtreres via .dockerignore) COPY . /usr/share/nginx/html -# Expose port EXPOSE 80 -CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file +CMD ["nginx", "-g", "daemon off;"] diff --git a/build-and-push.ps1 b/build-and-push.ps1 new file mode 100644 index 0000000..52e439c --- /dev/null +++ b/build-and-push.ps1 @@ -0,0 +1,31 @@ +#requires -Version 5.1 +<# +.SYNOPSIS + Bygger og pusher DKB-siden som reg.maximuss.dk/dkb:latest. +#> + +[CmdletBinding()] +param( + [string]$Registry = 'reg.maximuss.dk', + [string]$Image = 'dkb-banners', + [string]$Tag = 'latest' +) + +$ErrorActionPreference = 'Stop' +$fullName = "$Registry/${Image}:$Tag" + +Push-Location $PSScriptRoot +try { + Write-Host "==> Bygger $fullName" -ForegroundColor Cyan + docker build -t $fullName . + if ($LASTEXITCODE -ne 0) { throw "docker build fejlede ($LASTEXITCODE)" } + + Write-Host "==> Pusher $fullName" -ForegroundColor Cyan + docker push $fullName + if ($LASTEXITCODE -ne 0) { throw "docker push fejlede ($LASTEXITCODE)" } + + Write-Host "==> Færdig: $fullName" -ForegroundColor Green +} +finally { + Pop-Location +} diff --git a/index.html b/index.html index e8edff2..eb4840c 100644 --- a/index.html +++ b/index.html @@ -65,7 +65,7 @@ Gå til webshop -