Skip to content

Instantly share code, notes, and snippets.

@shrikeh
Created September 14, 2016 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shrikeh/dacfaf708ab85016e12765bccfb60d41 to your computer and use it in GitHub Desktop.
Save shrikeh/dacfaf708ab85016e12765bccfb60d41 to your computer and use it in GitHub Desktop.
---
version: '2'
networks:
memcached-frontend:
driver: bridge
redis-frontend:
driver: bridge
varnish-frontend:
driver: bridge
varnish-backend:
driver: bridge
php-fpm:
driver: bridge
services:
application:
build:
context: ./data-volume
volumes:
- "app:/demo"
frontend-openresty:
build:
context: ./frontend-openresty
dockerfile: Dockerfile-frontend-openresty
links:
- varnish
- redis-frontend
- memcached-frontend
depends_on:
- application
volumes:
- "app:/var/www/demo:nocopy,ro"
ports:
- "80:80"
networks:
- redis-frontend
- memcached-frontend
- varnish-frontend
redis-frontend:
image: redis
networks:
- redis-frontend
memcached-frontend:
image: memcached:1.4.31-alpine
networks:
memcached-frontend:
aliases:
- memcached-frontend
varnish:
build:
context: varnish
dockerfile: Dockerfile-varnish
networks:
varnish-frontend:
aliases:
- varnish-frontend
varnish-backend:
aliases:
- varnish-backend
backend-nginx:
build:
context: ./backend-nginx
dockerfile: Dockerfile-backend-nginx
links:
- varnish
- php-fpm
networks:
varnish-backend:
aliases:
- backend-nginx
php-fpm:
aliases:
- backend-nginx
php-fpm:
build:
context: ./php-fpm
dockerfile: Dockerfile-php-fpm
tmpfs:
- /var/www/demo/cache
volumes:
- "app:/var/www/demo:nocopy,ro"
networks:
- php-fpm
volumes:
app:
driver: local
FROM php:7.0.10-cli
COPY ./demo /demo
CMD 'echo Application demo container'
FROM openresty/openresty:1.11.2.1-xenial
MAINTAINER shrikeh@gmail.com
RUN mkdir -p /var/www/demo/web;
COPY ./conf /usr/local/openresty/nginx/conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment