Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add 1914-1918 decommission splash page docker setup #3

Merged
merged 5 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions decommissioned-site/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM nginx:stable-alpine

ENV NGINX_ENVSUBST_TEMPLATE_DIR=/usr/share/nginx/templates
ENV NGINX_ENVSUBST_OUTPUT_DIR=/usr/share/nginx/html
ENV DECOMMISSION_NOTICE="This site has been decommissioned."

COPY . /
27 changes: 27 additions & 0 deletions decommissioned-site/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Decommissioned site

NGINX Docker image which always responds with 200 static HTML content.

Intended to inform users about decommmisioned services.

Clients will receive an [HTML response](./usr/share/nginx/html/index.html). Which defaults to include the notice "This site has been decommissioned."

For specific deployements the notice text can be modified by setting an ENV value for `DECOMMISSION_NOTICE`.

Example:

```
ENV DECOMMISSION_NOTICE="This site has been decommissioned.</br>Find out more at <a href=\"https://www.europeana.eu\">Europeana.eu</a>."
```

## Build

```sh
docker build -t europeana/decommissioned-site .
```

## Run

```sh
docker run -p 8080:80 -it --name decommissioned-site europeana/decommissioned-site
```
17 changes: 17 additions & 0 deletions decommissioned-site/etc/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
server {
listen 80;
listen [::]:80;
server_name localhost;

location / {
try_files $uri $uri/ /index.html;
}

location ~/index\.html {
add_header 'Access-Control-Allow-Methods' '*' always;
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Headers' '*' always;

root /usr/share/nginx/html;
}
}
14 changes: 14 additions & 0 deletions decommissioned-site/usr/share/nginx/templates/index.html.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Service Unavailable</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Service Unavailable</h1>
<p>${DECOMMISSION_NOTICE}</p>
</body>
</html>