Created
March 7, 2017 11:30
-
-
Save bgadrian/4d6b3a52225193884a9e5762a72ec9a6 to your computer and use it in GitHub Desktop.
Static website when your servers are offline, with docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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