Skip to content

Commit

Permalink
Refatoração e troca do proxy
Browse files Browse the repository at this point in the history
Refatoração do código para melhor entendimento
Adição de novas tags para identificação e link com repositório
Troca do Haproxy pelo Varnish Cache
  • Loading branch information
unixelias committed Aug 10, 2017
2 parents b4ccfbc + 8df595e commit d79c466
Show file tree
Hide file tree
Showing 10 changed files with 224 additions and 70 deletions.
17 changes: 0 additions & 17 deletions .project

This file was deleted.

18 changes: 13 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
#!/bin/bash
#!/bin/bash
shopt -s extglob

for i in $( ls docker); do
case "$i" in
*-test ) ;;
* ) docker build -t unixelias/plone.idg:$i docker/$i && docker push unixelias/plone.idg:$i ;;
esac
case "$i" in
*-test ) ;;
* ) docker build -t unixelias/plone.idg:$i \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VCS_REF=`git rev-parse --short HEAD` docker/$i \
&& docker push unixelias/plone.idg:$i ;;
esac
done

# docker build -t unixelias/plone.idg:1.1.5-dev \
# --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
# --build-arg VCS_REF=`git rev-parse --short HEAD` docker/1.1.5-dev \
# && docker push unixelias/plone.idg:1.1.5-dev
24 changes: 13 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
version: "2"
services:
haproxy:
image: eeacms/haproxy
varnish:
image: eeacms/varnish
restart: 'always'
depends_on:
- ploneidg
ports:
- 8080:5000
- 1936:1936
- 8080:6081/tcp
environment:
- BACKENDS=ploneidg
- BACKENDS_PORT=8080
- SERVICE_NAMES=ploneidg
- DNS_ENABLED=true
- STATS_AUTH=admin:admin
BACKENDS: ploneidg
BACKENDS_PORT: '8080'
BACKENDS_PROBE_INTERVAL: 3s
BACKENDS_PROBE_THRESHOLD: '2'
BACKENDS_PROBE_TIMEOUT: 1s
BACKENDS_PROBE_WINDOW: '3'
DNS_ENABLED: 'true'
hostname: varnish
links:
- ploneidg:ploneidg

zeoserver:
hostname: 'zeoserver'
Expand Down
49 changes: 45 additions & 4 deletions docker/1.1.5.1-debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
FROM plone:4.3

MAINTAINER Elias Alves <elias.alves@ufvjm.edu.br>

LABEL Name="Modelo Plone v4.3 IDG escrito para implementação no Portal da UFVJM" \

ARG BUILD_DATE
ARG VCS_REF

LABEL Name="Plone v4.3 IDG" \
Version="1.1.5.1" \
Architecture="x86_64" \
Dockerfile_location="/root/buildinfo"
Dockerfile_location="/root/buildinfo" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="Plone v4.3 IDG" \
org.label-schema.description="Modelo Plone v4.3 IDG escrito para implementação no Portal da UFVJM" \
org.label-schema.url="http://portal.ufvjm.edu.br/" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/unixelias/plone.idg" \
org.label-schema.vendor="Elias Alves at UFVJM" \
org.label-schema.version="1.1.5" \
org.label-schema.version="1.1.5.1" \
org.label-schema.version="stable" \
org.label-schema.schema-version="1.0" \
org.label-schema.docker.cmd="docker run -p 8080:8080 -v ./data:/data unixelias/plone.idg"

USER plone
COPY site.cfg /plone/instance/
Expand All @@ -12,11 +31,32 @@ USER root
COPY Dockerfile /root/buildinfo

# Para Pillow 2.7.0
RUN buildDeps="curl sudo python-setuptools python-dev python-ldap build-essential libldap2-dev libsasl2-dev libssl-dev libxml2-dev libxslt1-dev libbz2-dev libjpeg62-turbo-dev libyaml-dev libgeos-c1 libgeos-dev" \
&& runDeps="cron" \
RUN buildDeps=" \
build-essential \
curl \
libbz2-dev \
libldap2-dev \
libjpeg62-turbo-dev \
libgeos-c1 \
libgeos-dev \
libsasl2-dev \
libssl-dev \
libyaml-dev \
libxml2-dev \
libxslt1-dev \
python-dev python-ldap \
python-setuptools \
sudo \
" \
&& runDeps=" \
apt-transport-https \
cron \
" \
&& apt-get update \
## Instala as dependências para tempo de compilação
&& apt-get install -y --no-install-recommends $buildDeps \
&& apt-get install -y $runDeps \
## Instala as dependências para tempo de execução
&& apt-get update && apt-get install -y $runDeps \
&& sudo -u plone bin/buildout -c site.cfg -t 300 \
&& SUDO_FORCE_REMOVE=yes apt-get purge -y --auto-remove $buildDeps \
&& rm -rf /var/lib/apt/lists/* \
Expand All @@ -29,4 +69,5 @@ USER plone
EXPOSE 8080

ENTRYPOINT ["/docker-entrypoint.sh"]

CMD ["start"]
36 changes: 24 additions & 12 deletions docker/1.1.5.1-debian/site.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,30 @@ extends =

[instance]
eggs +=
# Extensões mantidas pela comunidade PloneGov-BR
brasil.gov.portal
brasil.gov.facetada
brasil.gov.vlibrasnews
collective.opendata
# Extensões mantidas pelo Plone
plone.app.ldap
collective.lineage
collective.geo.bundle
collective.behavior.banner
collective.polls
Products.EasyNewsletter
# Extensões mantidas pela comunidade PloneGov-BR
brasil.gov.portal
brasil.gov.facetada
brasil.gov.vlibrasnews
collective.opendata
# Extensões mantidas pelo Plone
plone.app.ldap
collective.lineage
collective.geo.bundle
collective.behavior.banner
collective.polls
Products.EasyNewsletter
plone.recipe.varnish

[versions]
brasil.gov.portal = 1.1.5.1

[varnish-build]
recipe = zc.recipe.cmmi
url = https://repo.varnish-cache.org/source/varnish-4.1.8.tar.gz

[varnish]
recipe = plone.recipe.varnish
daemon = ${buildout:parts-directory}/varnish-build/sbin/varnishd
bind = varnish:6081
backends = 127.0.0.1:8080
cache-size = 1G
50 changes: 46 additions & 4 deletions docker/1.1.5.2-debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
FROM plone:4.3

MAINTAINER Elias Alves <elias.alves@ufvjm.edu.br>

LABEL Name="Modelo Plone v4.3 IDG escrito para implementação no Portal da UFVJM" \

ARG BUILD_DATE
ARG VCS_REF

LABEL Name="Plone v4.3 IDG" \
Version="1.1.5.2" \
Architecture="x86_64" \
Dockerfile_location="/root/buildinfo"
Dockerfile_location="/root/buildinfo" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="Plone v4.3 IDG" \
org.label-schema.description="Modelo Plone v4.3 IDG escrito para implementação no Portal da UFVJM" \
org.label-schema.url="http://portal.ufvjm.edu.br/" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/unixelias/plone.idg" \
org.label-schema.vendor="Elias Alves at UFVJM" \
org.label-schema.version="1.1.5" \
org.label-schema.version="1.1.5.2" \
org.label-schema.version="stable" \
org.label-schema.schema-version="1.0" \
org.label-schema.docker.cmd="docker run -p 8080:8080 -v ./data:/data unixelias/plone.idg"


USER plone
COPY site.cfg /plone/instance/
Expand All @@ -12,11 +32,32 @@ USER root
COPY Dockerfile /root/buildinfo

# Para Pillow 2.7.0
RUN buildDeps="curl sudo python-setuptools python-dev python-ldap build-essential libldap2-dev libsasl2-dev libssl-dev libxml2-dev libxslt1-dev libbz2-dev libjpeg62-turbo-dev libyaml-dev libgeos-c1 libgeos-dev" \
&& runDeps="cron" \
RUN buildDeps=" \
build-essential \
curl \
libbz2-dev \
libldap2-dev \
libjpeg62-turbo-dev \
libgeos-c1 \
libgeos-dev \
libsasl2-dev \
libssl-dev \
libyaml-dev \
libxml2-dev \
libxslt1-dev \
python-dev python-ldap \
python-setuptools \
sudo \
" \
&& runDeps=" \
apt-transport-https \
cron \
" \
&& apt-get update \
## Instala as dependências para tempo de compilação
&& apt-get install -y --no-install-recommends $buildDeps \
&& apt-get install -y $runDeps \
## Instala as dependências para tempo de execução
&& apt-get update && apt-get install -y $runDeps \
&& sudo -u plone bin/buildout -c site.cfg -t 300 \
&& SUDO_FORCE_REMOVE=yes apt-get purge -y --auto-remove $buildDeps \
&& rm -rf /var/lib/apt/lists/* \
Expand All @@ -29,4 +70,5 @@ USER plone
EXPOSE 8080

ENTRYPOINT ["/docker-entrypoint.sh"]

CMD ["start"]
36 changes: 24 additions & 12 deletions docker/1.1.5.2-debian/site.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,30 @@ extends =

[instance]
eggs +=
# Extensões mantidas pela comunidade PloneGov-BR
brasil.gov.portal
brasil.gov.facetada
brasil.gov.vlibrasnews
collective.opendata
# Extensões mantidas pelo Plone
plone.app.ldap
collective.lineage
collective.geo.bundle
collective.behavior.banner
collective.polls
Products.EasyNewsletter
# Extensões mantidas pela comunidade PloneGov-BR
brasil.gov.portal
brasil.gov.facetada
brasil.gov.vlibrasnews
collective.opendata
# Extensões mantidas pelo Plone
plone.app.ldap
collective.lineage
collective.geo.bundle
collective.behavior.banner
collective.polls
Products.EasyNewsletter
plone.recipe.varnish

[versions]
brasil.gov.portal = 1.1.5.1

[varnish-build]
recipe = zc.recipe.cmmi
url = https://repo.varnish-cache.org/source/varnish-4.1.8.tar.gz

[varnish]
recipe = plone.recipe.varnish
daemon = ${buildout:parts-directory}/varnish-build/sbin/varnishd
bind = varnish:6081
backends = 127.0.0.1:8080
cache-size = 1G
49 changes: 45 additions & 4 deletions docker/1.1.5.3-debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
FROM plone:4.3

MAINTAINER Elias Alves <elias.alves@ufvjm.edu.br>

LABEL Name="Modelo Plone v4.3 IDG escrito para implementação no Portal da UFVJM" \

ARG BUILD_DATE
ARG VCS_REF

LABEL Name="Plone v4.3 IDG" \
Version="1.1.5.3" \
Architecture="x86_64" \
Dockerfile_location="/root/buildinfo"
Dockerfile_location="/root/buildinfo" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="Plone v4.3 IDG" \
org.label-schema.description="Modelo Plone v4.3 IDG escrito para implementação no Portal da UFVJM" \
org.label-schema.url="http://portal.ufvjm.edu.br/" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/unixelias/plone.idg" \
org.label-schema.vendor="Elias Alves at UFVJM" \
org.label-schema.version="1.1.5" \
org.label-schema.version="1.1.5.3" \
org.label-schema.version="stable" \
org.label-schema.schema-version="1.0" \
org.label-schema.docker.cmd="docker run -p 8080:8080 -v ./data:/data unixelias/plone.idg"

USER plone
COPY site.cfg /plone/instance/
Expand All @@ -12,11 +31,32 @@ USER root
COPY Dockerfile /root/buildinfo

# Para Pillow 2.7.0
RUN buildDeps="curl sudo python-setuptools python-dev python-ldap build-essential libldap2-dev libsasl2-dev libssl-dev libxml2-dev libxslt1-dev libbz2-dev libjpeg62-turbo-dev libyaml-dev libgeos-c1 libgeos-dev" \
&& runDeps="cron" \
RUN buildDeps=" \
build-essential \
curl \
libbz2-dev \
libldap2-dev \
libjpeg62-turbo-dev \
libgeos-c1 \
libgeos-dev \
libsasl2-dev \
libssl-dev \
libyaml-dev \
libxml2-dev \
libxslt1-dev \
python-dev python-ldap \
python-setuptools \
sudo \
" \
&& runDeps=" \
apt-transport-https \
cron \
" \
&& apt-get update \
## Instala as dependências para tempo de compilação
&& apt-get install -y --no-install-recommends $buildDeps \
&& apt-get install -y $runDeps \
## Instala as dependências para tempo de execução
&& apt-get update && apt-get install -y $runDeps \
&& sudo -u plone bin/buildout -c site.cfg -t 300 \
&& SUDO_FORCE_REMOVE=yes apt-get purge -y --auto-remove $buildDeps \
&& rm -rf /var/lib/apt/lists/* \
Expand All @@ -29,4 +69,5 @@ USER plone
EXPOSE 8080

ENTRYPOINT ["/docker-entrypoint.sh"]

CMD ["start"]
12 changes: 12 additions & 0 deletions docker/1.1.5.3-debian/site.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ eggs +=
collective.behavior.banner
collective.polls
Products.EasyNewsletter
plone.recipe.varnish

[versions]
brasil.gov.portal = 1.1.5.1

[varnish-build]
recipe = zc.recipe.cmmi
url = https://repo.varnish-cache.org/source/varnish-4.1.8.tar.gz

[varnish]
recipe = plone.recipe.varnish
daemon = ${buildout:parts-directory}/varnish-build/sbin/varnishd
bind = varnish:6081
backends = 127.0.0.1:8080
cache-size = 1G

0 comments on commit d79c466

Please sign in to comment.