Skip to content
Snippets Groups Projects
Commit 5db4e3e4 authored by Dariusz Janny's avatar Dariusz Janny
Browse files

[edugain/faas#14] Initial revision of faas-registry

parent 4975c5a5
No related branches found
No related tags found
1 merge request!1[edugain/faas#14] Initial revision of faas-registry
/.project
FROM faas/faas-shib:1.0-SNAPSHOT
ARG FAAS_REGISTRY_IMAGE
ARG FAAS_REGISTRY_NAME
ARG FAAS_REGISTRY_VERSION
RUN echo $FAAS_REGISTRY_IMAGE > /faas-docker-image
RUN echo $FAAS_REGISTRY_NAME > /faas-docker-name
RUN echo $FAAS_REGISTRY_VERSION > /faas-docker-version
RUN apt-get -q update && \
apt-get install -y memcached apache2 composer git mc wget && \
apt-get install -y php-mysql php-curl php-memcached php-apcu php-cli php-bcmath php-xml libapache2-mod-php && \
apt-get -y autoremove && \
apt-get -y clean
RUN a2enmod rewrite
RUN git clone https://github.com/Edugate/Jagger /opt/rr3 && cd /opt/rr3 && git checkout v1.8.0
RUN git clone https://github.com/bcit-ci/CodeIgniter.git /opt/codeigniter && cd /opt/codeigniter && git checkout 3.1.11
RUN cd /opt/rr3 && bash install.sh && \
cd /opt/rr3/application/config && \
cp config-default.php config.php && \
cp config_rr-default.php config_rr.php && \
cp database-default.php database.php && \
cp email-default.php email.php && \
cp memcached-default.php memcached.php
RUN cp /opt/codeigniter/index.php /opt/rr3/index.php && \
sed -i 's#$system_path = \x27system\x27;#$system_path = \x27/opt/codeigniter/system\x27;#' /opt/rr3/index.php && \
cd /opt/rr3/application && \
composer install
EXPOSE 80
COPY ./conf/etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available
COPY ./conf/etc/entrypoint /etc/entrypoint
ENTRYPOINT ["/etc/entrypoint"]
\ No newline at end of file
Makefile 0 → 100644
# import config file
config ?= conf/faas-registry.cnf
include $(config)
export $(shell sed 's/=.*//' $(config))
.DEFAULT_GOAL := help
build: # build container
docker build -t ${FAAS_REGISTRY_IMAGE} --build-arg FAAS_REGISTRY_NAME=${FAAS_REGISTRY_NAME} --build-arg FAAS_REGISTRY_IMAGE=${FAAS_REGISTRY_IMAGE} --build-arg FAAS_REGISTRY_VERSION=${FAAS_REGISTRY_VERSION} .
build-nc: # build container without caching
docker build --no-cache -t ${FAAS_REGISTRY_IMAGE} --build-arg FAAS_REGISTRY_NAME=${FAAS_REGISTRY_NAME} --build-arg FAAS_REGISTRY_IMAGE=${FAAS_REGISTRY_IMAGE} --build-arg FAAS_REGISTRY_VERSION=${FAAS_REGISTRY_VERSION} .
run: # run container
docker run -i -t --detach --rm --env-file=$(config) -p=${FAAS_REGISTRY_PORT}:80 --name="${FAAS_REGISTRY_NAME}" ${FAAS_REGISTRY_IMAGE}
run-nd: # run container in no-deamon mode
docker run -i -t --rm --env-file=$(config) -p=${FAAS_REGISTRY_PORT}:80 --name="${FAAS_REGISTRY_NAME}" ${FAAS_REGISTRY_IMAGE}
up: build run # build and run container
logs: # print docker logs
docker logs ${FAAS_REGISTRY_NAME}
stop: # stop container
docker stop ${FAAS_REGISTRY_NAME}
version: # print current component version
@echo ${FAAS_REGISTRY_VERSION}
help: # this help
@awk 'BEGIN {FS = ":.*?# "} /^[a-zA-Z_-]+:.*?# / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
# FaaS-Registry # FaaS-Registry
Build docker image with debian (10.7) and Jagger
## structure
`_conf/`_ - directory with configuration files
## build image
To build `faas-registry` docker image
`
make build
`
## run image
To run `faas-registry` docker image
`
make run
`
## additional commands
```
build build container
build-nc build container without caching
run run container
run-nd run container in no-deamon mode
up build and run container
logs print docker logs
stop stop container
version print current component version
```
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /opt/rr3
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /rr3 /opt/rr3
<Directory /opt/rr3>
Require all granted
RewriteEngine On
RewriteBase /rr3
RewriteCond $1 !^(Shibboleth\.sso|index\.php|logos|signedmetadata|flags|images|app|schemas|fonts|styles|images|js|robots\.txt|pub|includes)
RewriteRule ^(.*)$ /rr3/index.php?/$1 [L]
</Directory>
<Directory /opt/rr3/application>
Require all granted
</Directory>
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
#! /bin/bash
sed -i '/imklog/s/^/#/' /etc/rsyslog.conf
sed -E -i -e 's/max_execution_time = 30/max_execution_time = 60/' /etc/php/7.4/apache2/php.ini
sed -E -i -e 's/memory_limit = 128M/memory_limit = 256M/' /etc/php/7.4/apache2/php.ini
sed -i 's#$config\[\x27base_url\x27\]\s=\s\x27\x27#$config\[\x27base_url\x27\] = \x27'${FAAS_REGISTRY_BASE_URL}'\x27#g' /opt/rr3/application/config/config.php
exec supervisord -c /etc/supervisord.conf
FAAS_REGISTRY_REPO=faas
FAAS_REGISTRY_NAME=faas-registry
FAAS_REGISTRY_VERSION=1.0-SNAPSHOT
FAAS_REGISTRY_IMAGE=${FAAS_REGISTRY_REPO}/${FAAS_REGISTRY_NAME}:${FAAS_REGISTRY_VERSION}
FAAS_REGISTRY_PORT=9080
FAAS_REGISTRY_BASE_URL=http://localhost:9080/rr3/
FAAS_REGISTRY_TIMEZONE=Europe/Warsaw
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment