OpenACS using S6

Table of Contents
Login

About

This is OpenACS on ubuntu base docker image (version 20.04) using s6-overlay. For install the OpenACS was used some code from Gustaf Neumann script install-oacs.sh. The base image is oupfiz5/openacs-s6.

OpenACS-S6 is self-hosting at https://chiselapp.com/user/oupfiz5/repository/openacs-s6.

If you are reading this on GitHub, then you are looking at a Git mirror of the self-hosting OpenACS-S6 repository. The purpose of that mirror is to test and exercise Fossil's ability to export a Git mirror and using Github CI/CD (Github Actions). Nobody much uses the GitHub mirror, except to verify that the mirror logic works. If you want to know more about OpenACS-S6, visit the official self-hosting site linked above.

Quickstart

The quickstart contains two variants:

Manage OpenACS using docker-compose.yaml

We use postgres image from datacore/postgresql in docker-compose.yaml file.

Prerequisite

Clone repository from:

Start/stop interactive

start:

docker-compose up

The site will be accessible by url http://localhost:8080.

stop:

<Ctrl>+C

Start/stop/remove as daemon

start :

docker-compose up -d

The site will be accessible by url http://localhost:8080.

stop:

docker-compose down

remove:

docker-compose rm

View logs

Logs follow:

docker-compose logs -f

Logs tail:

docker-compose logs --tail=10

View list containers

docker-compose ps

Prune all

docker system prune --volumes --force

Manage OpenACS using docker-compose-official-db.yaml

We use official posgres image in docker-compose-official-db.yaml file.

Prerequisite

Clone repository from:

Start/stop interactive

start:

docker-compose -f docker-compose-official-db.yaml up

The site will be accessible by url http://localhost:8080.

stop:

<Ctrl>+C

Start/stop/remove as daemon

start :

docker-compose -f docker-compose-official-db.yaml up -d

The site will be accessible by url http://localhost:8080.

stop:

docker-compose -f docker-compose-official-db.yaml down

remove:

docker-compose -f docker-compose-official-db.yaml rm

View logs

Logs follow:

docker-compose logs -f

Logs tail:

docker-compose logs --tail=10

View list containers

docker-compose ps

Prune all

docker system prune --volumes --force

Configuration options

General options

Option Default Description
TZ UTC Set timezone, example Europe/Moscow
OA_LISTEN_PORT 8080 Set http listen port, example 8080
NS_CONF openacs_config.tcl Configuration file for Naviserver
NS_VARS config_vars.tcl Variable file for Naviserver
DB_HOST postgres Database host name
DB_USER openacs Database user name
DB_PASS testing Database user password
POSTGRES_OFFICIAL_TAG 10-alpine Docker tag from official postgres.
POSTGRES_DATACORE_TAG 10.12 Docker tag from datacore/postgresql

All options have predifined values and store in file .env .

Timezone

Set the timezone for the containers, defaults to UTC. To set the timezone set the desired timezone with the variable TZ.

TZ="Europe/Moscow" docker-compose up

OpenACS listen port

OA_LISTEN_PORT set the http listen port for the openacs. In this case the OpenACS is accessible by URL http://localhost:8070.

OA_LISTEN_PORT=8070 docker-compose up

Naviserver configuration file

NS_CONF - configuration file. Default value is /usr/local/ns/conf/openacs-config.tcl

  1. Put the configuration file to rootfs/usr/local/ns/conf
  2. Run docker compose

    NS_CONF="/usr/local/ns/conf/my-config.tcl" docker-compose up

Naviserver variable file

NS_VARS - configuration file. Default value is /usr/local/ns/conf/config_vars.tcl Using for debug, configure etc.

  1. Put the configuration file to rootfs/usr/local/ns/conf
  2. Run docker compose

    NS_VARS="/usr/local/ns/conf/my_vars.tcl" docker-compose up

Database host

DB_HOST set the database host name for the openacs. By default it has name of docker-compose database service - postgres.

DB_HOST=foo docker-compose up

Database user

DB_USER set the database user name for the openacs and postgres.

DB_USER=foouser docker-compose up

Database password

DB_PASS set the database user password for the openacs and postgres.

DB_PASS=foopass docker-compose up

Postgres official tag

POSTGRES_OFFICIAL_TAG set the docker image tag for official postgres. Using only for docker-compose-official-db.yaml Pay attention - some openacs version can use only correspond version of postgres.

POSTGRES_OFFICIAL_TAG="10.16-alpine" docker-compose up

Postgres datacore tag

POSTGRES_DATACORE_TAG set the docker image tag for datacore postgres. Using only for docker-compose.yaml. Pay attention - some openacs version can use only correspond version of postgres.

POSTGRES_OFFICIAL_TAG="10.12" docker-compose up

CI/CD

For build and push docker images we use Github Actions workflow.

Build docker image

Build from chiselapp (fossil)

fossil clone https://chiselapp.com/user/oupfiz5/repository/openacs-s6 openacs-s6.fossil
mkdir openacs-s6
cd openacs-s6
fossil open ../openacs-s6.fossil
docker build -t oupfiz5/openacs-s6 -f ./Dockerfile .

Build from github

git clone https://github.com/oupfiz5/openacs-s6.git
cd openacs-s6
docker build -t oupfiz5/openacs-s6 -f ./Dockerfile .

Contfiguration

Build arguments

Arguments Default Description
BUILD_DATE none Set build date for label
OACS_VERSION 5.9.1 Set deafaul OpenACS version

Example of build

docker build --no-cache \
    --build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
    --build-arg OACS_VERSION="5.9.1" \
    -t oupfiz5/openacs-s6:5.9.1 \
    -t oupfiz5/openacs-s6:latest \
    -f ../Dockerfile \
    ../.

Download from DockerHub

You can download docker images from dockerhub:

docker pull oupfiz5/openacs-s6:latest
docker pull oupfiz5/openacs-s6:5.10

Maintenance

Shell access

For debugging and maintenance purposes you may want access the containers shell. If you are using Docker version 1.3.0 or higher you can access a running containers shell by starting bash using docker exec:

docker exec -it openacs-s6_openacs_1 /bin/bash

docker exec -it openacs-s6_postgres_1 /bin/bash