Skip to content

Instantly share code, notes, and snippets.

@bgadrian
Created March 7, 2017 11:30
Show Gist options
  • Save bgadrian/4d6b3a52225193884a9e5762a72ec9a6 to your computer and use it in GitHub Desktop.
Save bgadrian/4d6b3a52225193884a9e5762a72ec9a6 to your computer and use it in GitHub Desktop.
Static website when your servers are offline, with docker
FROM nginx:1.11.10
COPY nginx.conf /etc/nginx/conf.d/default.conf
#your static website source is in /maintenace/src/, copy it inside the container
COPY src/. /usr/share/nginx/html
server {
listen 80 default_server;
server_name .domain.com localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
error_page 404 /index.html;
}
#!/usr/bin/env bash
cd "$(dirname "$0")"
docker stop sccenter_maintenance
docker rm sccenter_maintenance
docker rmi -f sccenter_maintenance
docker build -t sccenter_maintenance --rm . && docker run --name sccenter_maintenance -p 80:80 --memory=512m -d sccenter_maintenance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment