Created
September 23, 2016 01:10
-
-
Save gilday/806871c7e55e68caf700c348c45f69b0 to your computer and use it in GitHub Desktop.
data only container for static web content
This file contains 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 | |
ADD ./index.html /usr/share/nginx/html/index.html | |
VOLUME /usr/share/nginx/html |
This file contains 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
<!doctype html> | |
<html> | |
<body> | |
<h1>Hello, World</h1> | |
</body> | |
</html> |
This file contains 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
version: '2' | |
services: | |
# frontend nginx steals web content volume from service "content" | |
frontend: | |
image: nginx | |
ports: | |
- 80 | |
volumes_from: | |
- content:ro | |
# build docker image with static content in /usr/share/nginx/html | |
# use nginx image to share layers | |
# reassign entrypoint to /bin/true so the container exits immediately - only need its volume | |
content: | |
build: ./content | |
entrypoint: /bin/true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment