Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
**

!www/bases_examples_Linux
!www/cgi-bin_Linux
!www/htdocs
!empweb
!docker/abcd
!docker/empweb

**/*~
**/*.log
**/.DS_Store
**/Thumbs.db
37 changes: 37 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Docker Image CI

on:
push:
tags: [ 'v*' ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: edsz14/abcd-isis

- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: docker/abcd/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
#tags: edsz14/abcd-isis:latest
40 changes: 40 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Docker Compose build and run

```
# create a subnet for ABCD
docker network create --subnet 172.18.18.0/24 abcd

# ensure www-data user is owner of the example database
chown -R 33:33 ./www/bases-examples_Linux

# start containers
docker-compose --project-directory . -f docker/docker-compose.yml up
```

# Start containers from dockerhub

Download the image with:
```
docker pull edsz14/abcd-isis
```

This command will start a container in the foreground (for testing/debugging, on port 8080):
```
docker run --rm -p 127.0.0.1:8080:80 --name abcd -v <path/to/bases/directory>:/var/opt/ABCD/bases edsz14/abcd-isis
```

This command will start a container in the background and ensure it is started automatically whenever docker is started (port 80, requires root):
```
# ensure the www-data user inside the container can read/write your bases
chown -R 33:33 <path/to/bases/directory>

# start the container on port 80
docker run --rm -d --restart always -p 127.0.0.1:80:80 --name abcd -v <path/to/bases/directory>:/var/opt/ABCD/bases edsz14/abcd-isis
```

# Reset data (optional)

Wipe logs and mysql data (for docker compose):
```
rm -rf docker/logs/* docker/mysql/data/*
```
23 changes: 23 additions & 0 deletions docker/abcd/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM php:8-apache

RUN apt-get update -y \
&& apt-get install -y libpng-dev libyaz-dev libxml2-dev zlib1g-dev libtidy-dev libxslt1-dev libyaz-dev libcurl4-openssl-dev \
&& rm -rf /var/lib/{apt,dpkg,cache,log}

RUN docker-php-ext-install pdo_mysql gd xsl curl \
&& pecl install yaz \
&& (pecl install xmlrpc || pecl install xmlrpc-1.0.0RC3) \
&& echo 'extension=yaz.so' > /usr/local/etc/php/conf.d/docker-php-ext-yaz.ini \
&& echo 'extension=xmlrpc.so' > /usr/local/etc/php/conf.d/docker-php-ext-xmlrpc.ini \
&& echo 'display_errors=off\nlog_errors=on' > /usr/local/etc/php/conf.d/docker-php-logging.ini

RUN a2enmod proxy_http cgi rewrite ldap

COPY ./www/cgi-bin_Linux /opt/ABCD/www/cgi-bin
COPY ./www/htdocs /opt/ABCD/www/htdocs
COPY ./www/htdocs/central/config.php.template /opt/ABCD/www/htdocs/central/config.php
COPY ./docker/abcd/apache.conf /etc/apache2/sites-available/000-default.conf

RUN ln -s /var/opt/ABCD/bases /opt/ABCD/www/bases

WORKDIR /opt/ABCD
46 changes: 46 additions & 0 deletions docker/abcd/apache.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<VirtualHost *:80>
ServerName abcd.localhost
ServerAdmin webmaster@localhost
Define ABCD_ROOT "/opt/ABCD/www"

DocumentRoot ${ABCD_ROOT}/htdocs

<Directory ${ABCD_ROOT}/>
Options +Indexes -FollowSymLinks
AllowOverride All
Require all granted
</Directory>

<Directory ${ABCD_ROOT}/htdocs>
Options +Indexes -FollowSymLinks +MultiViews
Require all granted
</Directory>

ScriptAlias /cgi-bin/ "${ABCD_ROOT}/cgi-bin/"
<Directory "$(ABCD_ROOT}/cgi-bin/">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
AddHandler cgi-script .cgi
AddHandler cgi-script .exe
Require all granted
</Directory>

Alias /docs/ "/var/opt/ABCD/bases/"
<Directory "/var/opt/ABCD/bases/">
Options -Indexes -FollowSymLinks -MultiViews
AllowOverride None
Require all granted
</Directory>

<Location /empweb>
ProxyPass http://empweb:8080/empweb
ProxyPassReverse http://empweb:8080/empweb
Order allow,deny
Allow from all
</Location>

# ErrorLog ${APACHE_LOG_DIR}/error.log
# CustomLog ${APACHE_LOG_DIR}/access.log combined
# ProxyPass /empweb/ http://127.0.0.1:8080/empweb/
# ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>
71 changes: 71 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
version: '3.4'

services:
abcd:
build:
context: .
dockerfile: ./docker/abcd/Dockerfile
image: abcd:latest
restart: always
hostname: abcd.abcd
container_name: abcd.abcd
expose:
- "80"
ports:
- "80:80"
volumes:
- ./www/bases-examples_Linux:/var/opt/ABCD/bases/
- ./docker/logs:/var/opt/ABCD/bases/log
networks:
abcd:
ipv4_address: 172.18.18.2
extra_hosts:
- "empweb:172.18.18.3"
# empweb:
# build:
# context: .
# dockerfile: ./docker/empweb/Dockerfile
# image: empweb:latest
# restart: always
# hostname: empweb.abcd
# container_name: empweb.abcd
# expose:
# - "8080"
# volumes:
# - ./docker/logs:/opt/ABCD/empweb/logs
# networks:
# abcd:
# ipv4_address: 172.18.18.3
# extra_hosts:
# - "abcd:172.18.18.2"
# - "mysql:172.18.18.4"
# depends_on:
# - "mysql"
# links:
# - "mysql"
# mysql:
# #image: mariadb:5.5.64
# image: mysql:5
# restart: always
# hostname: mysql.abcd
# container_name: mysql.abcd
# expose:
# - "3306"
# volumes:
# - ./docker/mysql/data:/var/lib/mysql:rw
# - ./docker/mysql/restore:/docker-entrypoint-initdb.d:ro
# environment:
# MYSQL_ROOT_PASSWORD: empweb
# MYSQL_DATABASE: transa
# networks:
# abcd:
# ipv4_address: 172.18.18.4

networks:
abcd:
external:
name: abcd
# ipam:
# driver: default
# config:
# - subnet: 172.18.18.0/24
17 changes: 17 additions & 0 deletions docker/empweb/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM java:7-jdk

ENV JETTY_HOME=/opt/ABCD/empweb/jetty
ENV JETTY_RUN=/opt/ABCD/empweb
ENV JAVA=/usr/bin/java

COPY ./www/cgi-bin_Linux /opt/ABCD/www/cgi-bin
COPY ./empweb /opt/ABCD/empweb
#COPY ./docker/empweb/mysql-connector-java-3.1.12-bin.jar /opt/ABCD/empweb/common/ext/mysql-connector-java-bin.jar
#COPY ./docker/empweb/mariadb-java-client-1.8.0.jar /opt/ABCD/empweb/common/ext/mysql-connector-java-bin.jar
#COPY ./docker/empweb/mariadb-java-client-2.7.3.jar /opt/ABCD/empweb/common/ext/mysql-connector-java-bin.jar
COPY ./docker/empweb/mysql-connector-java-5.1.49-bin.jar /opt/ABCD/empweb/common/ext/mysql-connector-java-bin.jar

WORKDIR /opt/ABCD

ENTRYPOINT ["/usr/bin/java"]
CMD ["-server","-DSTART=/opt/ABCD/empweb/common/etc/start.config","-Djetty.home=/opt/ABCD/empweb/jetty","-Dempweb.home=/opt/ABCD/empweb","-Djava.util.logging.config.file=/opt/ABCD/empweb/common/etc/logging.properties","-Daxis.xml.reuseParsers=true","-Dsun.net.client.defaultConnectTimeout=10000","-Dcisis.location=/opt/ABCD/www/cgi-bin/ansi/","-Dcisis.command=mx","-Dabcd.url=http://abcd","-Dcisis.platform=linux","-Xms128M","-Xmx128M","-Djetty.home=/opt/ABCD/empweb/jetty","-Djava.library.path=/opt/ABCD/empweb/common/ext","-Dfile.encoding=ISO8859_1","-jar","/opt/ABCD/empweb/jetty/start.jar","/opt/ABCD/empweb/common/etc/ewdbws-jetty.xml","/opt/ABCD/empweb/common/etc/ewengine-jetty.xml","/opt/ABCD/empweb/common/etc/ewgui-jetty.xml"]
Binary file added docker/empweb/mariadb-java-client-1.8.0.jar
Binary file not shown.
Binary file added docker/empweb/mariadb-java-client-2.7.3.jar
Binary file not shown.
Binary file not shown.
Empty file added docker/logs/.keepme
Empty file.
Empty file.