root Apostolos
5 years ago
8 changed files with 136 additions and 2 deletions
@ -0,0 +1,28 @@ |
|||||
|
<VirtualHost *:3001> |
||||
|
ServerName git.swarmlab.io |
||||
|
SSLEngine On |
||||
|
|
||||
|
SSLCertificateFile /opt/ssl/yourcertificate.crt |
||||
|
SSLCertificateKeyFile /opt/ssl/yourcertificate.key |
||||
|
|
||||
|
ErrorLog ${APACHE_LOG_DIR}/error.log |
||||
|
CustomLog ${APACHE_LOG_DIR}/access.log combined |
||||
|
SSLProxyEngine on |
||||
|
|
||||
|
<Location /> |
||||
|
ProxyPass / http://localhost:3000/ nocanon |
||||
|
ProxyPassReverse / http://localhost:3000/ |
||||
|
</Location> |
||||
|
<Directory /var/www/html/> |
||||
|
ProxyPreserveHost On |
||||
|
ProxyRequests off |
||||
|
AllowEncodedSlashes NoDecode |
||||
|
ProxyPass / https://localhost:3000/ nocanon |
||||
|
ProxyPassReverse / https://localhost:3000/ |
||||
|
Options Indexes FollowSymLinks MultiViews |
||||
|
#AddHandler markdown .md |
||||
|
AllowOverride All |
||||
|
Require all granted |
||||
|
</Directory> |
||||
|
|
||||
|
</VirtualHost> |
@ -0,0 +1,59 @@ |
|||||
|
#Choose Debian |
||||
|
FROM debian:jessie |
||||
|
|
||||
|
MAINTAINER DiouxX "github@diouxx.be" |
||||
|
|
||||
|
RUN echo "deb http://ftp.de.debian.org/debian stretch main" >> /etc/apt/sources.list |
||||
|
|
||||
|
#Don't ask questions during install |
||||
|
ENV DEBIAN_FRONTEND noninteractive |
||||
|
|
||||
|
#Install apache2 and enable proxy mode |
||||
|
RUN apt update \ |
||||
|
&& apt -y install \ |
||||
|
apache2 \ |
||||
|
&& rm -rf /var/lib/apt/lists/* |
||||
|
|
||||
|
#libapache2-mod-auth-cas \ |
||||
|
#php7.0-mysql \ |
||||
|
#php7.0-opcache \ |
||||
|
#php7.0-common \ |
||||
|
#curl \ |
||||
|
#php7.0-mbstring \ |
||||
|
#php7.0-mcrypt \ |
||||
|
#php7.0-cli \ |
||||
|
#php7.0-intl \ |
||||
|
#php7.0-json \ |
||||
|
#php7.0-xsl \ |
||||
|
#php7.0-curl \ |
||||
|
#php7.0-memcached \ |
||||
|
#php7.0-readline \ |
||||
|
#php7.0-recode \ |
||||
|
#php7.0-fpm \ |
||||
|
#php7.0 \ |
||||
|
#libapache2-mod-php7.0 libapache2-mod-php \ |
||||
|
|
||||
|
RUN a2enmod proxy \ |
||||
|
&& a2enmod proxy_http \ |
||||
|
&& a2enmod ssl \ |
||||
|
&& a2enmod headers \ |
||||
|
&& a2enmod rewrite \ |
||||
|
&& a2enmod proxy_wstunnel \ |
||||
|
&& service apache2 stop |
||||
|
#&& a2enmod auth_cas \ |
||||
|
#&& a2enmod php7.0 \ |
||||
|
|
||||
|
#Ports |
||||
|
EXPOSE 80 443 8080 |
||||
|
|
||||
|
#Volumes |
||||
|
VOLUME /opt/proxy-conf |
||||
|
VOLUME /opt/ssl |
||||
|
VOLUME /opt/logs |
||||
|
VOLUME /opt/www |
||||
|
VOLUME /opt/private |
||||
|
|
||||
|
#Launch Apache2 on FOREGROUND |
||||
|
COPY apache-proxy-start.sh /opt/ |
||||
|
RUN chmod +x /opt/apache-proxy-start.sh |
||||
|
ENTRYPOINT ["/opt/apache-proxy-start.sh"] |
@ -0,0 +1 @@ |
|||||
|
docker build -t registry.vlabs.uniwa.gr:5080/vlab-apache2-proxy-ssl -t registry.vlabs.uniwa.gr:5043/vlab-apache2-proxy-ssl . |
@ -0,0 +1,13 @@ |
|||||
|
#!/bin/bash |
||||
|
|
||||
|
#Copy virtualhost on apache directory |
||||
|
cp /opt/proxy-conf/*.conf /etc/apache2/sites-available/ |
||||
|
|
||||
|
#List site and enable |
||||
|
ls /etc/apache2/sites-available/ -1A | a2ensite *.conf |
||||
|
|
||||
|
# Apache gets grumpy about PID files pre-existing |
||||
|
rm -f /var/run/apache2/apache2.pid |
||||
|
|
||||
|
#Launch Apache on Foreground |
||||
|
/usr/sbin/apache2ctl -D FOREGROUND |
@ -0,0 +1,30 @@ |
|||||
|
version: "3.3" |
||||
|
services: |
||||
|
|
||||
|
server_proxy: |
||||
|
#image: registry.vlabs.uniwa.gr:5043/swarmlab-apache2-markdown |
||||
|
image: registry.vlabs.uniwa.gr:5080/vlab-apache2-proxy-ssl:latest |
||||
|
networks: |
||||
|
- git-net |
||||
|
deploy: |
||||
|
replicas: 1 |
||||
|
placement: |
||||
|
constraints: |
||||
|
- node.id == ${REGISTERid} |
||||
|
ports: |
||||
|
- 3000:443 |
||||
|
- 3043:8080 |
||||
|
|
||||
|
|
||||
|
volumes: |
||||
|
- "/var/lib/swarmlab.io/gitproxy/ssl:/opt/ssl" |
||||
|
- "/var/lib/swarmlab.io/gitproxy/conf:/opt/proxy-conf" |
||||
|
- "/var/lib/swarmlab.io/gitproxy/apache2/apache2.conf:/etc/apache2/apache2.conf" |
||||
|
- "/var/lib/swarmlab.io/gitproxy/apache2/ports.conf:/etc/apache2/ports.conf" |
||||
|
- "/var/lib/swarmlab.io/gitproxy/www:/opt/www" |
||||
|
- "/var/lib/swarmlab.io/gitproxy/private:/opt/private" |
||||
|
|
||||
|
|
||||
|
networks: |
||||
|
git-net: |
||||
|
|
@ -0,0 +1,2 @@ |
|||||
|
docker service rm git_server_proxy |
||||
|
env REGISTERid=c50xzv12mz3cux1mcdz4ypznc docker stack deploy -c git-proxy.yaml git |
@ -1 +1,2 @@ |
|||||
|
docker service rm git_db git_server |
||||
env REGISTERid=c50xzv12mz3cux1mcdz4ypznc docker stack deploy -c git.yaml git |
env REGISTERid=c50xzv12mz3cux1mcdz4ypznc docker stack deploy -c git.yaml git |
||||
|
Loading…
Reference in new issue