From 3445b5b1b64ef5d234364ccedf0a4f215e276909 Mon Sep 17 00:00:00 2001 From: ZeroC0D3 Team Date: Thu, 23 Mar 2017 13:52:11 +0700 Subject: [PATCH 01/19] Add docker file haproxy --- haproxy/Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 haproxy/Dockerfile diff --git a/haproxy/Dockerfile b/haproxy/Dockerfile new file mode 100644 index 00000000..76659f3e --- /dev/null +++ b/haproxy/Dockerfile @@ -0,0 +1,4 @@ +FROM dockercloud/haproxy:latest +MAINTAINER ZeroC0D3 Team + +EXPOSE 80 From b35a23d89e97bc1688245537ddde6f5dadfc9214 Mon Sep 17 00:00:00 2001 From: ZeroC0D3 Team Date: Thu, 23 Mar 2017 13:52:30 +0700 Subject: [PATCH 02/19] Add docker file varnish --- varnish/Dockerfile | 26 +++ varnish/default.vcl | 415 ++++++++++++++++++++++++++++++++++++++++++++ varnish/start.sh | 17 ++ 3 files changed, 458 insertions(+) create mode 100644 varnish/Dockerfile create mode 100644 varnish/default.vcl create mode 100644 varnish/start.sh diff --git a/varnish/Dockerfile b/varnish/Dockerfile new file mode 100644 index 00000000..b5e80202 --- /dev/null +++ b/varnish/Dockerfile @@ -0,0 +1,26 @@ +FROM debian:latest +MAINTAINER ZeroC0D3 Team + +# Set Environment Variables +ENV DEBIAN_FRONTEND noninteractive + +# Install Dependencies +RUN apt-get update && apt-get install -y apt-utils && apt-get upgrade -y +RUN mkdir /home/site && mkdir /home/site/cache +RUN apt-get install -y varnish +RUN rm -rf /var/lib/apt/lists/* + +# Setting Configurations +ENV VARNISH_CONFIG /etc/varnish/default.vcl +ENV CACHE_SIZE 128m +ENV VARNISHD_PARAMS -p default_ttl=3600 -p default_grace=3600 +ENV VARNISH_PORT 6081 +ENV BACKEND_HOST localhost +ENV BACKEND_PORT 80 + +ADD default.vcl /etc/varnish/default.vcl +ADD start.sh /etc/varnish/start.sh + +RUN chmod +x /etc/varnish/start.sh + +CMD ["/etc/varnish/start.sh"] diff --git a/varnish/default.vcl b/varnish/default.vcl new file mode 100644 index 00000000..155a863a --- /dev/null +++ b/varnish/default.vcl @@ -0,0 +1,415 @@ +vcl 4.0; +# Based on: https://github.com/mattiasgeniar/varnish-4.0-configuration-templates/blob/master/default.vcl + +import std; +import directors; + +backend server1 { # Define one backend + .host = "${BACKEND_HOST}"; # IP or Hostname of backend + .port = "${BACKEND_PORT}"; # Port Apache or whatever is listening + .max_connections = 300; # That's it + + .probe = { + #.url = "/"; # short easy way (GET /) + # We prefer to only do a HEAD / + .request = + "HEAD / HTTP/1.1" + "Host: ${BACKEND_HOST}" + "Connection: close" + "User-Agent: Varnish Health Probe"; + + .interval = 5s; # check the health of each backend every 5 seconds + .timeout = 1s; # timing out after 1 second. + .window = 5; # If 3 out of the last 5 polls succeeded the backend is considered healthy, otherwise it will be marked as sick + .threshold = 3; + } + + .first_byte_timeout = 300s; # How long to wait before we receive a first byte from our backend? + .connect_timeout = 5s; # How long to wait for a backend connection? + .between_bytes_timeout = 2s; # How long to wait between bytes received from our backend? +} + +acl purge { + # ACL we'll use later to allow purges + "localhost"; + "127.0.0.1"; + "::1"; +} + +#acl editors { +# # ACL to honor the "Cache-Control: no-cache" header to force a refresh but only from selected IPs +# "localhost"; +# "127.0.0.1"; +# "::1"; +#} + +sub vcl_init { + # Called when VCL is loaded, before any requests pass through it. + # Typically used to initialize VMODs. + + new vdir = directors.round_robin(); + vdir.add_backend(server1); + # vdir.add_backend(servern); +} + +sub vcl_recv { + # Called at the beginning of a request, after the complete request has been received and parsed. + # Its purpose is to decide whether or not to serve the request, how to do it, and, if applicable, + # which backend to use. + # also used to modify the request + + set req.backend_hint = vdir.backend(); # send all traffic to the vdir director + + # Normalize the header, remove the port (in case you're testing this on various TCP ports) + set req.http.Host = regsub(req.http.Host, ":[0-9]+", ""); + + # Remove the proxy header (see https://httpoxy.org/#mitigate-varnish) + unset req.http.proxy; + + # Normalize the query arguments + set req.url = std.querysort(req.url); + + # Allow purging + if (req.method == "PURGE") { + if (!client.ip ~ purge) { # purge is the ACL defined at the begining + # Not from an allowed IP? Then die with an error. + return (synth(405, "This IP is not allowed to send PURGE requests.")); + } + # If you got this stage (and didn't error out above), purge the cached result + return (purge); + } + + # Only deal with "normal" types + if (req.method != "GET" && + req.method != "HEAD" && + req.method != "PUT" && + req.method != "POST" && + req.method != "TRACE" && + req.method != "OPTIONS" && + req.method != "PATCH" && + req.method != "DELETE") { + # Non-RFC2616 or CONNECT which is weird. + return (pipe); + } + + # Implementing websocket support (https://www.varnish-cache.org/docs/4.0/users-guide/vcl-example-websockets.html) + if (req.http.Upgrade ~ "(?i)websocket") { + return (pipe); + } + + # Only cache GET or HEAD requests. This makes sure the POST requests are always passed. + if (req.method != "GET" && req.method != "HEAD") { + return (pass); + } + + # Some generic URL manipulation, useful for all templates that follow + # First remove the Google Analytics added parameters, useless for our backend + if (req.url ~ "(\?|&)(utm_source|utm_medium|utm_campaign|utm_content|gclid|cx|ie|cof|siteurl)=") { + set req.url = regsuball(req.url, "&(utm_source|utm_medium|utm_campaign|utm_content|gclid|cx|ie|cof|siteurl)=([A-z0-9_\-\.%25]+)", ""); + set req.url = regsuball(req.url, "\?(utm_source|utm_medium|utm_campaign|utm_content|gclid|cx|ie|cof|siteurl)=([A-z0-9_\-\.%25]+)", "?"); + set req.url = regsub(req.url, "\?&", "?"); + set req.url = regsub(req.url, "\?$", ""); + } + + # Strip hash, server doesn't need it. + if (req.url ~ "\#") { + set req.url = regsub(req.url, "\#.*$", ""); + } + + # Strip a trailing ? if it exists + if (req.url ~ "\?$") { + set req.url = regsub(req.url, "\?$", ""); + } + + # Some generic cookie manipulation, useful for all templates that follow + # Remove the "has_js" cookie + set req.http.Cookie = regsuball(req.http.Cookie, "has_js=[^;]+(; )?", ""); + + # Remove any Google Analytics based cookies + set req.http.Cookie = regsuball(req.http.Cookie, "__utm.=[^;]+(; )?", ""); + set req.http.Cookie = regsuball(req.http.Cookie, "_ga=[^;]+(; )?", ""); + set req.http.Cookie = regsuball(req.http.Cookie, "_gat=[^;]+(; )?", ""); + set req.http.Cookie = regsuball(req.http.Cookie, "utmctr=[^;]+(; )?", ""); + set req.http.Cookie = regsuball(req.http.Cookie, "utmcmd.=[^;]+(; )?", ""); + set req.http.Cookie = regsuball(req.http.Cookie, "utmccn.=[^;]+(; )?", ""); + + # Remove DoubleClick offensive cookies + set req.http.Cookie = regsuball(req.http.Cookie, "__gads=[^;]+(; )?", ""); + + # Remove the Quant Capital cookies (added by some plugin, all __qca) + set req.http.Cookie = regsuball(req.http.Cookie, "__qc.=[^;]+(; )?", ""); + + # Remove the AddThis cookies + set req.http.Cookie = regsuball(req.http.Cookie, "__atuv.=[^;]+(; )?", ""); + + # Remove a ";" prefix in the cookie if present + set req.http.Cookie = regsuball(req.http.Cookie, "^;\s*", ""); + + # Are there cookies left with only spaces or that are empty? + if (req.http.cookie ~ "^\s*$") { + unset req.http.cookie; + } + + if (req.http.Cache-Control ~ "(?i)no-cache") { + #if (req.http.Cache-Control ~ "(?i)no-cache" && client.ip ~ editors) { # create the acl editors if you want to restrict the Ctrl-F5 + # http://varnish.projects.linpro.no/wiki/VCLExampleEnableForceRefresh + # Ignore requests via proxy caches and badly behaved crawlers + # like msnbot that send no-cache with every request. + if (! (req.http.Via || req.http.User-Agent ~ "(?i)bot" || req.http.X-Purge)) { + #set req.hash_always_miss = true; # Doesn't seems to refresh the object in the cache + return(purge); # Couple this with restart in vcl_purge and X-Purge header to avoid loops + } + } + + # Large static files are delivered directly to the end-user without + # waiting for Varnish to fully read the file first. + # Varnish 4 fully supports Streaming, so set do_stream in vcl_backend_response() + if (req.url ~ "^[^?]*\.(7z|avi|bz2|flac|flv|gz|mka|mkv|mov|mp3|mp4|mpeg|mpg|ogg|ogm|opus|rar|tar|tgz|tbz|txz|wav|webm|xz|zip)(\?.*)?$") { + unset req.http.Cookie; + return (hash); + } + + # Remove all cookies for static files + # A valid discussion could be held on this line: do you really need to cache static files that don't cause load? Only if you have memory left. + # Sure, there's disk I/O, but chances are your OS will already have these files in their buffers (thus memory). + # Before you blindly enable this, have a read here: https://ma.ttias.be/stop-caching-static-files/ + if (req.url ~ "^[^?]*\.(7z|avi|bmp|bz2|css|csv|doc|docx|eot|flac|flv|gif|gz|ico|jpeg|jpg|js|less|mka|mkv|mov|mp3|mp4|mpeg|mpg|odt|otf|ogg|ogm|opus|pdf|png|ppt|pptx|rar|rtf|svg|svgz|swf|tar|tbz|tgz|ttf|txt|txz|wav|webm|webp|woff|woff2|xls|xlsx|xml|xz|zip)(\?.*)?$") { + unset req.http.Cookie; + return (hash); + } + + # Send Surrogate-Capability headers to announce ESI support to backend + set req.http.Surrogate-Capability = "key=ESI/1.0"; + + if (req.http.Authorization) { + # Not cacheable by default + return (pass); + } + + return (hash); +} + +sub vcl_pipe { + # Called upon entering pipe mode. + # In this mode, the request is passed on to the backend, and any further data from both the client + # and backend is passed on unaltered until either end closes the connection. Basically, Varnish will + # degrade into a simple TCP proxy, shuffling bytes back and forth. For a connection in pipe mode, + # no other VCL subroutine will ever get called after vcl_pipe. + + # Note that only the first request to the backend will have + # X-Forwarded-For set. If you use X-Forwarded-For and want to + # have it set for all requests, make sure to have: + # set bereq.http.connection = "close"; + # here. It is not set by default as it might break some broken web + # applications, like IIS with NTLM authentication. + + # set bereq.http.Connection = "Close"; + + # Implementing websocket support (https://www.varnish-cache.org/docs/4.0/users-guide/vcl-example-websockets.html) + if (req.http.upgrade) { + set bereq.http.upgrade = req.http.upgrade; + } + + return (pipe); +} + +sub vcl_pass { + # Called upon entering pass mode. In this mode, the request is passed on to the backend, and the + # backend's response is passed on to the client, but is not entered into the cache. Subsequent + # requests submitted over the same client connection are handled normally. + + # return (pass); +} + +# The data on which the hashing will take place +sub vcl_hash { + # Called after vcl_recv to create a hash value for the request. This is used as a key + # to look up the object in Varnish. + + hash_data(req.url); + + if (req.http.host) { + hash_data(req.http.host); + } else { + hash_data(server.ip); + } + + # hash cookies for requests that have them + if (req.http.Cookie) { + hash_data(req.http.Cookie); + } +} + +sub vcl_hit { + # Called when a cache lookup is successful. + + if (obj.ttl >= 0s) { + # A pure unadultered hit, deliver it + return (deliver); + } + + # https://www.varnish-cache.org/docs/trunk/users-guide/vcl-grace.html + # When several clients are requesting the same page Varnish will send one request to the backend and place the others on hold while fetching one copy from the backend. In some products this is called request coalescing and Varnish does this automatically. + # If you are serving thousands of hits per second the queue of waiting requests can get huge. There are two potential problems - one is a thundering herd problem - suddenly releasing a thousand threads to serve content might send the load sky high. Secondly - nobody likes to wait. To deal with this we can instruct Varnish to keep the objects in cache beyond their TTL and to serve the waiting requests somewhat stale content. + + # if (!std.healthy(req.backend_hint) && (obj.ttl + obj.grace > 0s)) { + # return (deliver); + # } else { + # return (fetch); + # } + + # We have no fresh fish. Lets look at the stale ones. + if (std.healthy(req.backend_hint)) { + # Backend is healthy. Limit age to 10s. + if (obj.ttl + 10s > 0s) { + #set req.http.grace = "normal(limited)"; + return (deliver); + } else { + # No candidate for grace. Fetch a fresh object. + return(fetch); + } + } else { + # backend is sick - use full grace + if (obj.ttl + obj.grace > 0s) { + #set req.http.grace = "full"; + return (deliver); + } else { + # no graced object. + return (fetch); + } + } + + # fetch & deliver once we get the result + return (fetch); # Dead code, keep as a safeguard +} + +sub vcl_miss { + # Called after a cache lookup if the requested document was not found in the cache. Its purpose + # is to decide whether or not to attempt to retrieve the document from the backend, and which + # backend to use. + + return (fetch); +} + +# Handle the HTTP request coming from our backend +sub vcl_backend_response { + # Called after the response headers has been successfully retrieved from the backend. + + # Pause ESI request and remove Surrogate-Control header + if (beresp.http.Surrogate-Control ~ "ESI/1.0") { + unset beresp.http.Surrogate-Control; + set beresp.do_esi = true; + } + + # Enable cache for all static files + # The same argument as the static caches from above: monitor your cache size, if you get data nuked out of it, consider giving up the static file cache. + # Before you blindly enable this, have a read here: https://ma.ttias.be/stop-caching-static-files/ + if (bereq.url ~ "^[^?]*\.(7z|avi|bmp|bz2|css|csv|doc|docx|eot|flac|flv|gif|gz|ico|jpeg|jpg|js|less|mka|mkv|mov|mp3|mp4|mpeg|mpg|odt|otf|ogg|ogm|opus|pdf|png|ppt|pptx|rar|rtf|svg|svgz|swf|tar|tbz|tgz|ttf|txt|txz|wav|webm|webp|woff|woff2|xls|xlsx|xml|xz|zip)(\?.*)?$") { + unset beresp.http.set-cookie; + } + + # Large static files are delivered directly to the end-user without + # waiting for Varnish to fully read the file first. + # Varnish 4 fully supports Streaming, so use streaming here to avoid locking. + if (bereq.url ~ "^[^?]*\.(7z|avi|bz2|flac|flv|gz|mka|mkv|mov|mp3|mp4|mpeg|mpg|ogg|ogm|opus|rar|tar|tgz|tbz|txz|wav|webm|xz|zip)(\?.*)?$") { + unset beresp.http.set-cookie; + set beresp.do_stream = true; # Check memory usage it'll grow in fetch_chunksize blocks (128k by default) if the backend doesn't send a Content-Length header, so only enable it for big objects + } + + # Sometimes, a 301 or 302 redirect formed via Apache's mod_rewrite can mess with the HTTP port that is being passed along. + # This often happens with simple rewrite rules in a scenario where Varnish runs on :80 and Apache on :8080 on the same box. + # A redirect can then often redirect the end-user to a URL on :8080, where it should be :80. + # This may need finetuning on your setup. + # + # To prevent accidental replace, we only filter the 301/302 redirects for now. + if (beresp.status == 301 || beresp.status == 302) { + set beresp.http.Location = regsub(beresp.http.Location, ":[0-9]+", ""); + } + + # Set 2min cache if unset for static files + if (beresp.ttl <= 0s || beresp.http.Set-Cookie || beresp.http.Vary == "*") { + set beresp.ttl = 120s; # Important, you shouldn't rely on this, SET YOUR HEADERS in the backend + set beresp.uncacheable = true; + return (deliver); + } + + # Don't cache 50x responses + if (beresp.status == 500 || beresp.status == 502 || beresp.status == 503 || beresp.status == 504) { + return (abandon); + } + + # Allow stale content, in case the backend goes down. + # make Varnish keep all objects for 6 hours beyond their TTL + set beresp.grace = 6h; + + return (deliver); +} + +# The routine when we deliver the HTTP request to the user +# Last chance to modify headers that are sent to the client +sub vcl_deliver { + # Called before a cached object is delivered to the client. + + if (obj.hits > 0) { # Add debug header to see if it's a HIT/MISS and the number of hits, disable when not needed + set resp.http.X-Cache = "HIT"; + } else { + set resp.http.X-Cache = "MISS"; + } + + # Please note that obj.hits behaviour changed in 4.0, now it counts per objecthead, not per object + # and obj.hits may not be reset in some cases where bans are in use. See bug 1492 for details. + # So take hits with a grain of salt + set resp.http.X-Cache-Hits = obj.hits; + + # Remove some headers: PHP version + unset resp.http.X-Powered-By; + + # Remove some headers: Apache version & OS + unset resp.http.Server; + unset resp.http.X-Drupal-Cache; + unset resp.http.X-Varnish; + unset resp.http.Via; + unset resp.http.Link; + unset resp.http.X-Generator; + unset resp.http.X-Debug-Token; + unset resp.http.X-Debug-Token-Link; + set resp.http.Server = "${VARNISH_SERVER}"; + set resp.http.X-Powered-By = "MSI"; + + return (deliver); +} + +sub vcl_purge { + # Only handle actual PURGE HTTP methods, everything else is discarded + if (req.method != "PURGE") { + # restart request + set req.http.X-Purge = "Yes"; + return(restart); + } +} + +sub vcl_synth { + if (resp.status == 720) { + # We use this special error status 720 to force redirects with 301 (permanent) redirects + # To use this, call the following from anywhere in vcl_recv: return (synth(720, "http://host/new.html")); + set resp.http.Location = resp.reason; + set resp.status = 301; + return (deliver); + } elseif (resp.status == 721) { + # And we use error status 721 to force redirects with a 302 (temporary) redirect + # To use this, call the following from anywhere in vcl_recv: return (synth(720, "http://host/new.html")); + set resp.http.Location = resp.reason; + set resp.status = 302; + return (deliver); + } + + return (deliver); +} + + +sub vcl_fini { + # Called when VCL is discarded only after all requests have exited the VCL. + # Typically used to clean up VMODs. + + return (ok); +} diff --git a/varnish/start.sh b/varnish/start.sh new file mode 100644 index 00000000..e14511a9 --- /dev/null +++ b/varnish/start.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -e + +for name in BACKEND_PORT BACKEND_HOST VARNISH_SERVER +do + eval value=\$$name + sed -i "s|\${${name}}|${value}|g" /etc/varnish/default.vcl +done + +exec bash -c \ + "exec varnishd \ + -a :$VARNISH_PORT \ + -T localhost:6082 \ + -F -u varnish \ + -f $VARNISH_CONFIG \ + -s malloc,$CACHE_SIZE \ + $VARNISHD_PARAMS" \ No newline at end of file From 40422ab4b0a1448fd0c5dd9478750719399fc97b Mon Sep 17 00:00:00 2001 From: ZeroC0D3 Team Date: Thu, 23 Mar 2017 13:53:26 +0700 Subject: [PATCH 03/19] Update environment for varnish & haproxy --- env-example | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/env-example b/env-example index 4405222f..4160e115 100644 --- a/env-example +++ b/env-example @@ -75,7 +75,6 @@ MARIADB_USER=default MARIADB_PASSWORD=secret MARIADB_PORT=3306 - ### POSTGRES Container POSTGRES_DB=default POSTGRES_USER=default @@ -118,6 +117,25 @@ PMA_PASSWORD=secret PMA_ROOT_PASSWORD=secret PMA_PORT=88 +### VARNISH Container +VARNISH_CONFIG=/etc/varnish/default.vcl +VARNISH_PORT=8080 +VARNISH_BACKEND_PORT=8888 +VARNISHD_PARAMS=-p default_ttl=3600 -p default_grace=3600 + +### Varnish Proxy 1 Container +VARNISH_PROXY1_CACHE_SIZE=128m +VARNISH_PROXY1_BACKEND_HOST=server1 +VARNISH_PROXY1_SERVER=SERVER1 + +### Varnish Proxy 2 Container +VARNISH_PROXY2_CACHE_SIZE=128m +VARNISH_PROXY2_BACKEND_HOST=server2 +VARNISH_PROXY2_SERVER=SERVER2 + +### HAPROXY Container +HAPROXY_HOST_HTTP_PORT=80 + ### MISC # Replace with your Docker Host IP (will be appended to /etc/hosts) DOCKER_HOST_IP=10.0.75.1 From 5d74e10b086cffd017b19e2500e49d95c60c8f8b Mon Sep 17 00:00:00 2001 From: ZeroC0D3 Team Date: Thu, 23 Mar 2017 13:53:52 +0700 Subject: [PATCH 04/19] Update docker compose file for load balancer --- docker-compose.yml | 198 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 158 insertions(+), 40 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 97c9e004..2ed86dfb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,10 +37,13 @@ services: volumes_from: - applications extra_hosts: - - "dockerhost:${DOCKER_HOST_IP}" + - "dockerhost:${DOCKER_HOST_IP}" ports: - - "${WORKSPACE_SSH_PORT}:22" + - "${WORKSPACE_SSH_PORT}:22" tty: true + networks: + - frontend + - backend ### PHP-FPM Container ####################################### @@ -57,7 +60,7 @@ services: - INSTALL_MEMCACHED=${PHP_FPM_INSTALL_MEMCACHED} - INSTALL_OPCACHE=${PHP_FPM_INSTALL_OPCACHE} - INSTALL_EXIF=${PHP_FPM_INSTALL_EXIF} - - INSTALL_AEROSPIKE_EXTENSION=${PHP_FPM_INSTALL_AEROSPIKE_EXTENSION} + - INSTALL_AEROSPIKE_EXTENSION=${PHP_FPM_INSTALL_AEROSPIKE_EXTENSION} - INSTALL_MYSQLI=${PHP_FPM_INSTALL_MYSQLI} - INSTALL_TOKENIZER=${PHP_FPM_INSTALL_TOKENIZER} - INSTALL_INTL=${PHP_FPM_INSTALL_INTL} @@ -72,7 +75,9 @@ services: - "dockerhost:${DOCKER_HOST_IP}" environment: - PHP_IDE_CONFIG=${PHP_IDE_CONFIG} - + networks: + - backend + ### PHP Worker Container ##################################### php-worker: build: @@ -81,6 +86,8 @@ services: - applications depends_on: - workspace + networks: + - backend ### Nginx Server Container ################################## @@ -90,15 +97,18 @@ services: args: - PHP_UPSTREAM=php-fpm volumes_from: - - applications + - applications volumes: - - ${NGINX_HOST_LOG_PATH}:/var/log/nginx - - ${NGINX_SITES_PATH}:/etc/nginx/sites-available + - ${NGINX_HOST_LOG_PATH}:/var/log/nginx + - ${NGINX_SITES_PATH}:/etc/nginx/sites-available ports: - - "${NGINX_HOST_HTTP_PORT}:80" - - "${NGINX_HOST_HTTPS_PORT}:443" + - "${NGINX_HOST_HTTP_PORT}:80" + - "${NGINX_HOST_HTTPS_PORT}:443" depends_on: - - php-fpm + - php-fpm + networks: + - frontend + - backend ### Apache Server Container ################################# @@ -117,6 +127,9 @@ services: - "${APACHE_HOST_HTTPS_PORT}:443" depends_on: - php-fpm + networks: + - frontend + - backend ### HHVM Container ########################################## @@ -128,6 +141,9 @@ services: - "9000" depends_on: - workspace + networks: + - frontend + - backend ### Minio Container ######################################### @@ -140,6 +156,8 @@ services: environment: - MINIO_ACCESS_KEY=access - MINIO_SECRET_KEY=secretkey + networks: + - backend ### MySQL Container ######################################### @@ -155,6 +173,8 @@ services: - mysql:/var/lib/mysql ports: - "${MYSQL_PORT}:3306" + networks: + - backend ### MariaDB Container ####################################### @@ -169,6 +189,8 @@ services: - MYSQL_USER=${MARIADB_USER} - MYSQL_PASSWORD=${MARIADB_PASSWORD} - MYSQL_ROOT_PASSWORD=${MARIADB_PORT} + networks: + - backend ### PostgreSQL Container #################################### @@ -182,6 +204,8 @@ services: - POSTGRES_DB=${POSTGRES_DB} - POSTGRES_USER=${POSTGRES_USER} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + networks: + - backend ### PostgreSQL PostGis Container ############################ @@ -195,6 +219,8 @@ services: - POSTGRES_DB=${POSTGRES_DB} - POSTGRES_USER=${POSTGRES_USER} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + networks: + - backend ### Neo4j Container ######################################### @@ -207,6 +233,8 @@ services: - NEO4J_AUTH=default:secret volumes: - neo4j:/var/lib/neo4j/data + networks: + - backend ### MongoDB Container ####################################### @@ -216,6 +244,8 @@ services: - "27017:27017" volumes: - mongo:/data/db + networks: + - backend ### RethinkDB Container ####################################### @@ -225,6 +255,8 @@ services: - "8090:8080" volumes: - rethinkdb:/data/rethinkdb_data + networks: + - backend ### Redis Container ######################################### @@ -234,6 +266,8 @@ services: - redis:/data ports: - "6379:6379" + networks: + - backend ### Aerospike c Container ################################### @@ -248,6 +282,8 @@ services: - "3001:3001" - "3002:3002" - "3003:3003" + networks: + - backend ### Memcached Container ##################################### @@ -259,6 +295,8 @@ services: - "${MEMCACHED_HOST_PORT}:11211" depends_on: - php-fpm + networks: + - backend ### Beanstalkd Container #################################### @@ -269,6 +307,8 @@ services: privileged: true depends_on: - php-fpm + networks: + - backend ### RabbitMQ Container ###################################### @@ -284,6 +324,8 @@ services: - RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS} depends_on: - php-fpm + networks: + - backend ### Beanstalkd Console Container ############################ @@ -293,6 +335,8 @@ services: - "2080:2080" depends_on: - beanstalkd + networks: + - backend ### Caddy Server Container ################################## @@ -310,6 +354,8 @@ services: - caddy:/root/.caddy depends_on: - php-fpm + networks: + - backend ### phpMyAdmin Container #################################### @@ -324,6 +370,8 @@ services: - "${PMA_PORT}:80" depends_on: - "${PMA_DB_ENGINE}" + networks: + - frontend ### pgAdmin Container ####################################### @@ -333,6 +381,8 @@ services: - "5050:5050" depends_on: - postgres + networks: + - frontend ### ElasticSearch Container ################################# @@ -346,6 +396,8 @@ services: - "${ELASTICSEARCH_HOST_TRANSPORT_PORT}:9300" depends_on: - php-fpm + networks: + - backend ### Certbot Container ################################## @@ -358,6 +410,8 @@ services: environment: - CN="fake.domain.com" - EMAIL="fake.email@gmail.com" + networks: + - backend ### Mailhog Container ######################################### @@ -366,8 +420,10 @@ services: ports: - "1025:1025" - "8025:8025" + networks: + - backend -### Selenium Container ######################################### +### Selenium Container ######################################## selenium: build: ./selenium @@ -375,35 +431,97 @@ services: - "${SELENIUM_PORT}:4444" volumes: - /dev/shm:/dev/shm + networks: + - backend -### Volumes Setup ########################################### +### Varnish Proxy 1 ########################################## + + proxy: + build: ./varnish + expose: + - ${VARNISH_PORT} + environment: + - VARNISH_CONFIG=${VARNISH_CONFIG} + - CACHE_SIZE=${VARNISH_PROXY1_CACHE_SIZE} + - VARNISHD_PARAMS=${VARNISHD_PARAMS} + - VARNISH_PORT=${VARNISH_PORT} + - BACKEND_HOST=${VARNISH_PROXY1_BACKEND_HOST} + - BACKEND_PORT=${VARNISH_BACKEND_PORT} + - VARNISH_SERVER=${VARNISH_PROXY1_SERVER} + links: + - workspace + networks: + - frontend + +### Varnish Proxy 2 ########################################## + + proxy2: + build: ./varnish + expose: + - ${VARNISH_PORT} + environment: + - VARNISH_CONFIG=${VARNISH_CONFIG} + - CACHE_SIZE=${VARNISH_PROXY2_CACHE_SIZE} + - VARNISHD_PARAMS=${VARNISHD_PARAMS} + - VARNISH_PORT=${VARNISH_PORT} + - BACKEND_HOST=${VARNISH_PROXY2_BACKEND_HOST} + - BACKEND_PORT=${VARNISH_BACKEND_PORT} + - VARNISH_SERVER=${VARNISH_PROXY2_SERVER} + links: + - workspace + networks: + - frontend + +### Balancer Haproxy ########################################## + +balancer: + build: ./haproxy + ports: + - "${HAPROXY_HOST_HTTP_PORT}:80" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + links: + - proxy + - proxy2 + networks: + - frontend + +### Networks Setup ############################################ + +networks: + frontend: + driver: "bridge" + backend: + driver: "bridge" + +### Volumes Setup ############################################# volumes: - mysql: - driver: "local" - postgres: - driver: "local" - memcached: - driver: "local" - redis: - driver: "local" - neo4j: - driver: "local" - mariadb: - driver: "local" - mongo: - driver: "local" - minio: - driver: "local" - rethinkdb: - driver: "local" - phpmyadmin: - driver: "local" - aerospike: - driver: "local" - caddy: - driver: "local" - elasticsearch-data: - driver: "local" - elasticsearch-plugins: - driver: "local" + mysql: + driver: "local" + postgres: + driver: "local" + memcached: + driver: "local" + redis: + driver: "local" + neo4j: + driver: "local" + mariadb: + driver: "local" + mongo: + driver: "local" + minio: + driver: "local" + rethinkdb: + driver: "local" + phpmyadmin: + driver: "local" + aerospike: + driver: "local" + caddy: + driver: "local" + elasticsearch-data: + driver: "local" + elasticsearch-plugins: + driver: "local" From d60178f5980d78e55c277a1b46916f0ccb3e9627 Mon Sep 17 00:00:00 2001 From: ZeroC0D3 Team Date: Thu, 23 Mar 2017 14:07:25 +0700 Subject: [PATCH 05/19] Add expose port for varnish --- varnish/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/varnish/Dockerfile b/varnish/Dockerfile index b5e80202..13c3e2ab 100644 --- a/varnish/Dockerfile +++ b/varnish/Dockerfile @@ -24,3 +24,5 @@ ADD start.sh /etc/varnish/start.sh RUN chmod +x /etc/varnish/start.sh CMD ["/etc/varnish/start.sh"] + +EXPOSE 8080 From 9dad1586af818c9b9654f517f4addb05de3d3b00 Mon Sep 17 00:00:00 2001 From: ZeroC0D3 Team Date: Thu, 23 Mar 2017 15:01:32 +0700 Subject: [PATCH 06/19] Fixing identitation for docker-compose haproxy --- docker-compose.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 2ed86dfb..fe56093c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -474,17 +474,17 @@ services: ### Balancer Haproxy ########################################## -balancer: - build: ./haproxy - ports: - - "${HAPROXY_HOST_HTTP_PORT}:80" - volumes: - - /var/run/docker.sock:/var/run/docker.sock - links: - - proxy - - proxy2 - networks: - - frontend + balancer: + build: ./haproxy + ports: + - "${HAPROXY_HOST_HTTP_PORT}:80" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + links: + - proxy + - proxy2 + networks: + - frontend ### Networks Setup ############################################ From 7d49f9b820815fa39aef8eb53bcae0adb260f32e Mon Sep 17 00:00:00 2001 From: ZeroC0D3 Team Date: Thu, 23 Mar 2017 16:07:59 +0700 Subject: [PATCH 07/19] Fixing workspace_yarn_version --- docker-compose.yml | 62 +++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 97c9e004..119b5261 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -32,7 +32,7 @@ services: - PUID=${WORKSPACE_PUID} - PGID=${WORKSPACE_PGID} - NODE_VERSION=${WORKSPACE_NODE_VERSION} - - YARN_VERSION=${WORKSPACE_TIMEZONE} + - YARN_VERSION=${WORKSPACE_YARN_VERSION} - TZ=${WORKSPACE_TIMEZONE} volumes_from: - applications @@ -57,7 +57,7 @@ services: - INSTALL_MEMCACHED=${PHP_FPM_INSTALL_MEMCACHED} - INSTALL_OPCACHE=${PHP_FPM_INSTALL_OPCACHE} - INSTALL_EXIF=${PHP_FPM_INSTALL_EXIF} - - INSTALL_AEROSPIKE_EXTENSION=${PHP_FPM_INSTALL_AEROSPIKE_EXTENSION} + - INSTALL_AEROSPIKE_EXTENSION=${PHP_FPM_INSTALL_AEROSPIKE_EXTENSION} - INSTALL_MYSQLI=${PHP_FPM_INSTALL_MYSQLI} - INSTALL_TOKENIZER=${PHP_FPM_INSTALL_TOKENIZER} - INSTALL_INTL=${PHP_FPM_INSTALL_INTL} @@ -72,7 +72,7 @@ services: - "dockerhost:${DOCKER_HOST_IP}" environment: - PHP_IDE_CONFIG=${PHP_IDE_CONFIG} - + ### PHP Worker Container ##################################### php-worker: build: @@ -379,31 +379,31 @@ services: ### Volumes Setup ########################################### volumes: - mysql: - driver: "local" - postgres: - driver: "local" - memcached: - driver: "local" - redis: - driver: "local" - neo4j: - driver: "local" - mariadb: - driver: "local" - mongo: - driver: "local" - minio: - driver: "local" - rethinkdb: - driver: "local" - phpmyadmin: - driver: "local" - aerospike: - driver: "local" - caddy: - driver: "local" - elasticsearch-data: - driver: "local" - elasticsearch-plugins: - driver: "local" + mysql: + driver: "local" + postgres: + driver: "local" + memcached: + driver: "local" + redis: + driver: "local" + neo4j: + driver: "local" + mariadb: + driver: "local" + mongo: + driver: "local" + minio: + driver: "local" + rethinkdb: + driver: "local" + phpmyadmin: + driver: "local" + aerospike: + driver: "local" + caddy: + driver: "local" + elasticsearch-data: + driver: "local" + elasticsearch-plugins: + driver: "local" From b81e3e8f156c6773c4263393e3344efdf69151ea Mon Sep 17 00:00:00 2001 From: ZeroC0D3 Team Date: Thu, 23 Mar 2017 16:32:11 +0700 Subject: [PATCH 08/19] Fixing workspace_yarn_version --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index fe56093c..8a21767f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -32,7 +32,7 @@ services: - PUID=${WORKSPACE_PUID} - PGID=${WORKSPACE_PGID} - NODE_VERSION=${WORKSPACE_NODE_VERSION} - - YARN_VERSION=${WORKSPACE_TIMEZONE} + - YARN_VERSION=${WORKSPACE_YARN_VERSION} - TZ=${WORKSPACE_TIMEZONE} volumes_from: - applications From 69b223a370751578731bf707e09622349e0b6f68 Mon Sep 17 00:00:00 2001 From: ZeroC0D3 Team Date: Fri, 24 Mar 2017 10:12:42 +0700 Subject: [PATCH 09/19] Remove duplicate type MAINTAINER --- workspace/Dockerfile-71 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workspace/Dockerfile-71 b/workspace/Dockerfile-71 index 1f9fb855..43312667 100644 --- a/workspace/Dockerfile-71 +++ b/workspace/Dockerfile-71 @@ -12,7 +12,7 @@ FROM laradock/workspace:1.3 # placeholder. Need change after new image would be built. -MAINTAINER MAINTAINER Mahmoud Zalt +MAINTAINER Mahmoud Zalt # #-------------------------------------------------------------------------- From 3881a5d66dbae635a8e46b6d04c6a8a26682111b Mon Sep 17 00:00:00 2001 From: ZeroC0D3 Team Date: Fri, 24 Mar 2017 10:13:16 +0700 Subject: [PATCH 10/19] Remove duplicate type MAINTAINER --- workspace/Dockerfile-71 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workspace/Dockerfile-71 b/workspace/Dockerfile-71 index 1f9fb855..43312667 100644 --- a/workspace/Dockerfile-71 +++ b/workspace/Dockerfile-71 @@ -12,7 +12,7 @@ FROM laradock/workspace:1.3 # placeholder. Need change after new image would be built. -MAINTAINER MAINTAINER Mahmoud Zalt +MAINTAINER Mahmoud Zalt # #-------------------------------------------------------------------------- From d152050e2946822d4e40e5083b12ef1ee153f9ae Mon Sep 17 00:00:00 2001 From: ZeroC0D3 Team Date: Sat, 25 Mar 2017 20:50:35 +0700 Subject: [PATCH 11/19] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9cad0e80..4d9e5f8a 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,8 @@ Laradock is a Docker PHP development environment that facilitate running **PHP** - [Bo-Yi Wu](https://github.com/appleboy) (appleboy) [ [Twitter](https://twitter.com/appleboy) ] - [Philippe Trépanier](https://github.com/philtrep) (philtrep) - [Mike Erickson](https://github.com/mikeerickson) (mikeerickson) -- Join Us! +- [Dwi Fahni Denni](https://github.com/zeroc0d3) (zeroc0d3) +- Join Us. **Amazing Contributors:** From 5d5545ec9e6e53f16cbdd51f947e213886bdabf2 Mon Sep 17 00:00:00 2001 From: ZeroC0D3 Team Date: Sat, 25 Mar 2017 20:51:24 +0700 Subject: [PATCH 12/19] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9cad0e80..4d9e5f8a 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,8 @@ Laradock is a Docker PHP development environment that facilitate running **PHP** - [Bo-Yi Wu](https://github.com/appleboy) (appleboy) [ [Twitter](https://twitter.com/appleboy) ] - [Philippe Trépanier](https://github.com/philtrep) (philtrep) - [Mike Erickson](https://github.com/mikeerickson) (mikeerickson) -- Join Us! +- [Dwi Fahni Denni](https://github.com/zeroc0d3) (zeroc0d3) +- Join Us. **Amazing Contributors:** From 38545cfffdd59f422aaee3b092cfcad71bdaf586 Mon Sep 17 00:00:00 2001 From: ZeroC0D3 Team Date: Sun, 26 Mar 2017 07:28:04 +0700 Subject: [PATCH 13/19] Update env-example for mssql --- env-example | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/env-example b/env-example index 4160e115..bddf0d86 100644 --- a/env-example +++ b/env-example @@ -69,6 +69,11 @@ MYSQL_PASSWORD=secret MYSQL_PORT=3306 MYSQL_ROOT_PASSWORD=root +### MSSQL Container +MSSQL_DATABASE=homestead +MSSQL_PASSWORD=yourStrong(!)Password +MSSQL_PORT=1433 + ### MARIADB Container MARIADB_DATABASE=default MARIADB_USER=default From c340d851d36eac359d1fed445504b615184c63aa Mon Sep 17 00:00:00 2001 From: ZeroC0D3 Team Date: Sun, 26 Mar 2017 07:30:59 +0700 Subject: [PATCH 14/19] Add mssql volumes --- docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index cde5c83e..ba9b2a09 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -515,6 +515,8 @@ networks: volumes: mysql: driver: "local" + mssql: + driver: "local" postgres: driver: "local" memcached: From 236665d7d3e39f1ed37dd07f4ec6fffce5d9ca04 Mon Sep 17 00:00:00 2001 From: ZeroC0D3 Team Date: Sun, 26 Mar 2017 08:13:14 +0700 Subject: [PATCH 15/19] Change haproxy port to 8085 --- docker-compose.yml | 2 +- env-example | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index ba9b2a09..211d0c55 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -493,7 +493,7 @@ services: balancer: build: ./haproxy ports: - - "${HAPROXY_HOST_HTTP_PORT}:80" + - "${HAPROXY_HOST_HTTP_PORT}:8085" volumes: - /var/run/docker.sock:/var/run/docker.sock links: diff --git a/env-example b/env-example index bddf0d86..42545d47 100644 --- a/env-example +++ b/env-example @@ -139,7 +139,7 @@ VARNISH_PROXY2_BACKEND_HOST=server2 VARNISH_PROXY2_SERVER=SERVER2 ### HAPROXY Container -HAPROXY_HOST_HTTP_PORT=80 +HAPROXY_HOST_HTTP_PORT=8085 ### MISC # Replace with your Docker Host IP (will be appended to /etc/hosts) From cf9abcd5b8a7d7696395ed68a540ab38826fd5fe Mon Sep 17 00:00:00 2001 From: ZeroC0D3 Team Date: Sun, 26 Mar 2017 12:33:27 +0700 Subject: [PATCH 16/19] Change env-example varnish backend host to 'workspace' --- env-example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/env-example b/env-example index 42545d47..51eeeb0d 100644 --- a/env-example +++ b/env-example @@ -130,12 +130,12 @@ VARNISHD_PARAMS=-p default_ttl=3600 -p default_grace=3600 ### Varnish Proxy 1 Container VARNISH_PROXY1_CACHE_SIZE=128m -VARNISH_PROXY1_BACKEND_HOST=server1 +VARNISH_PROXY1_BACKEND_HOST=workspace VARNISH_PROXY1_SERVER=SERVER1 ### Varnish Proxy 2 Container VARNISH_PROXY2_CACHE_SIZE=128m -VARNISH_PROXY2_BACKEND_HOST=server2 +VARNISH_PROXY2_BACKEND_HOST=workspace VARNISH_PROXY2_SERVER=SERVER2 ### HAPROXY Container From 4f5746f2a7e48123a0cf9c7927fa991fecdce9ad Mon Sep 17 00:00:00 2001 From: ZeroC0D3 Team Date: Sun, 26 Mar 2017 14:56:55 +0700 Subject: [PATCH 17/19] Refactoring Maintainer Docker File --- certbot/Dockerfile | 2 ++ haproxy/Dockerfile | 1 + hhvm/Dockerfile | 2 ++ mailhog/Dockerfile | 2 +- mssql/Dockerfile | 4 +++- php-worker/Dockerfile | 2 ++ postgres-postgis/Dockerfile | 4 +++- rabbitmq/Dockerfile | 2 ++ varnish/Dockerfile | 1 + 9 files changed, 17 insertions(+), 3 deletions(-) diff --git a/certbot/Dockerfile b/certbot/Dockerfile index c62405e9..3ce7546f 100644 --- a/certbot/Dockerfile +++ b/certbot/Dockerfile @@ -1,5 +1,7 @@ FROM phusion/baseimage:latest +MAINTAINER Mahmoud Zalt + COPY run-certbot.sh /root/certbot/run-certbot.sh RUN apt-get update diff --git a/haproxy/Dockerfile b/haproxy/Dockerfile index 76659f3e..ceca7191 100644 --- a/haproxy/Dockerfile +++ b/haproxy/Dockerfile @@ -1,4 +1,5 @@ FROM dockercloud/haproxy:latest + MAINTAINER ZeroC0D3 Team EXPOSE 80 diff --git a/hhvm/Dockerfile b/hhvm/Dockerfile index cca2c55b..b4404a66 100644 --- a/hhvm/Dockerfile +++ b/hhvm/Dockerfile @@ -1,5 +1,7 @@ FROM ubuntu:14.04 +MAINTAINER Mahmoud Zalt + RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449 RUN apt-get update -y \ diff --git a/mailhog/Dockerfile b/mailhog/Dockerfile index 9fd31e4e..4b404d16 100644 --- a/mailhog/Dockerfile +++ b/mailhog/Dockerfile @@ -1,6 +1,6 @@ FROM mailhog/mailhog -Maintainer Mahmoud Zalt +MAINTAINER Mahmoud Zalt CMD ["Mailhog"] diff --git a/mssql/Dockerfile b/mssql/Dockerfile index fd9f0761..de67f6d7 100644 --- a/mssql/Dockerfile +++ b/mssql/Dockerfile @@ -1,5 +1,7 @@ FROM microsoft/mssql-server-linux +MAINTAINER Mahmoud Zalt + # Create config directory # an set it as WORKDIR RUN mkdir -p /usr/src/app @@ -18,4 +20,4 @@ VOLUME /var/opt/mssql EXPOSE 1433 -CMD /bin/bash ./entrypoint.sh \ No newline at end of file +CMD /bin/bash ./entrypoint.sh diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile index 13c6d95f..58de7d5b 100644 --- a/php-worker/Dockerfile +++ b/php-worker/Dockerfile @@ -9,6 +9,8 @@ FROM nielsvdoorn/laravel-supervisor +MAINTAINER Mahmoud Zalt + # #-------------------------------------------------------------------------- # Optional Supervisord Configuration diff --git a/postgres-postgis/Dockerfile b/postgres-postgis/Dockerfile index c7d9ea6d..23e65862 100644 --- a/postgres-postgis/Dockerfile +++ b/postgres-postgis/Dockerfile @@ -1,5 +1,7 @@ FROM mdillon/postgis:latest +MAINTAINER Mahmoud Zalt + CMD ["postgres"] -EXPOSE 5432 \ No newline at end of file +EXPOSE 5432 diff --git a/rabbitmq/Dockerfile b/rabbitmq/Dockerfile index 48727d2d..ad73a2a1 100644 --- a/rabbitmq/Dockerfile +++ b/rabbitmq/Dockerfile @@ -1,5 +1,7 @@ FROM rabbitmq +MAINTAINER Mahmoud Zalt + RUN rabbitmq-plugins enable --offline rabbitmq_management EXPOSE 15671 15672 diff --git a/varnish/Dockerfile b/varnish/Dockerfile index 13c3e2ab..a4f61a99 100644 --- a/varnish/Dockerfile +++ b/varnish/Dockerfile @@ -1,4 +1,5 @@ FROM debian:latest + MAINTAINER ZeroC0D3 Team # Set Environment Variables From 1fd55d98e1f2edf90a2f21c2cffc6bd795137525 Mon Sep 17 00:00:00 2001 From: ZeroC0D3 Team Date: Sun, 26 Mar 2017 16:31:18 +0700 Subject: [PATCH 18/19] Changing map network in docker-compose file --- docker-compose.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 878cf2ed..e8928b46 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -157,7 +157,7 @@ services: - MINIO_ACCESS_KEY=access - MINIO_SECRET_KEY=secretkey networks: - - backend + - frontend ### MySQL Container ######################################### @@ -385,6 +385,7 @@ services: depends_on: - php-fpm networks: + - frontend - backend ### phpMyAdmin Container #################################### @@ -427,7 +428,7 @@ services: depends_on: - php-fpm networks: - - backend + - frontend ### Certbot Container ################################## @@ -441,7 +442,7 @@ services: - CN="fake.domain.com" - EMAIL="fake.email@gmail.com" networks: - - backend + - frontend ### Mailhog Container ######################################### @@ -451,7 +452,7 @@ services: - "1025:1025" - "8025:8025" networks: - - backend + - frontend ### Selenium Container ######################################## @@ -462,7 +463,7 @@ services: volumes: - /dev/shm:/dev/shm networks: - - backend + - frontend ### Varnish Proxy 1 ########################################## From fc460f94978faa1465d8d9e599d8d04a2548d7f7 Mon Sep 17 00:00:00 2001 From: ZeroC0D3 Team Date: Wed, 29 Mar 2017 13:59:53 +0700 Subject: [PATCH 19/19] Remove duplicate mssql & remove network setup for balancer --- docker-compose.yml | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index e8928b46..24d1f349 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -176,7 +176,7 @@ services: networks: - backend -### MsSQL Container ######################################### +### MSSQL Container ######################################### mssql: build: @@ -192,20 +192,6 @@ services: networks: - backend -### MsSQL Container ######################################### - - mssql: - build: - context: ./mssql - environment: - - MSSQL_DATABASE=${MSSQL_DATABASE} - - SA_PASSWORD=${MSSQL_PASSWORD} - - ACCEPT_EULA=Y - volumes: - - mssql:/var/opt/mssql - ports: - - "${MSSQL_PORT}:1433" - ### MariaDB Container ####################################### mariadb: @@ -514,8 +500,6 @@ services: links: - proxy - proxy2 - networks: - - frontend ### Networks Setup ############################################