This is OpenACS on ALT Linux base docker image (version sisyphus) using s6-overlay. To install OpenACS I used code from Gustaf Neumann script install-oacs.sh. The base image is oupfiz5/alt-s6-openacs.
AltLinux OpenACS-S6 is self-hosting at https://chiselapp.com/user/oupfiz5/repository/al-s6-openacs.
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 AltLinux OpenACS-S6, visit the official self-hosting site linked above.
- *nix operation system
- Install Docker
- Install git (optional)
- Install fossil (optional)
They are using for testing and scanning:
- Bats
- Shellcheck
- Hadolynt
- Dockle
- Snyk - not necessarily
- Trivy - not necessarily
fossil clone https://chiselapp.com/user/oupfiz5/repository/alt-s6-openacs alt-s6-openacs.fossil
mkdir alt-s6-openacs
cd alt-s6-openacs
fossil open ../alt-s6-openacs.fossil
docker build -t oupfiz5/alt-s6-openacs -f ./Dockerfile .
You can download docker images from dockerhub:
docker pull oupfiz5/alt-s6-openacs:oacs-5-10
git clone https://github.com/oupfiz5/alt-s6-openacs.git
cd alt-s6-openacs
docker build -t oupfiz5/alt-s6-openacs -f ./Dockerfile .
Arguments | Default | Description |
---|---|---|
BUILD_DATE | none | Set build date for label |
OACS_TAG | oacs-5-10 | Set OpenACS version |
NS_IMAGE_TAG | 4.99.24 | Set NaviServer version |
NS_IMAGE_REPOSITORY | oupfiz5 | Set NaviServer repository |
NS_IMAGE_NAME | alt-s6-naviserver | Set NaviServer image name |
IMAGE_NAME | alt-s6-openacs | Set OpenaACS image name |
IMAGE_REPOSITORY | oupfiz5 | Set OpenACS repository |
IMAGE_TAG | oacs-5-10 | Set OpenACS image tag |
set -a; source ../VERSIONS ; set +a;
IMAGE="${IMAGE:-${IMAGE_REPOSITORY}/${IMAGE_NAME}:${IMAGE_TAG}}"
docker build --no-cache \
--build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
--build-arg OACS_TAG="oacs-5-10" \
-t "${IMAGE}" \
-f ./Dockerfile \
.
Clone repository from:
-
fossil:
fossil clone https://chiselapp.com/user/oupfiz5/repository/alt-s6-openacs alt-s6-openacs.fossil mkdir alt-s6-openacs cd alt-s6-openacs fossil open ../alt-s6-openacs.fossil
-
GitHub:
git clone https://github.com/oupfiz5/alt-s6-openacs.git cd alt-s6-openacs
start:
docker compose up
The site will be accessible by url http://localhost:8080.
stop:
<Ctrl>+C
start :
docker compose up -d
The site will be accessible by url http://localhost:8080.
stop:
docker compose down
remove:
docker compose rm
Logs follow:
docker compose logs -f
Logs tail:
docker compose logs --tail=10
docker compose ps
docker system prune --volumes --force
Option | Default | Description |
---|---|---|
NS_CONF | openacs-config.tcl | Full path to configuration file |
oacs_db_host* | ${PGHOST} | Set database host for OpenACS |
oacs_db_name* | ${PGDATABASE} | Set database name for OpenACS |
oacs_db_passwod* | ${PGPASSWORD} | Set db user password for OpenACS |
oacs_db_port* | ${PGPORT} | Set database port for OpenACS |
oacs_db_user* | ${PGUSER} | Set database user for OpenACS |
oacs_httpport* | 8000 | Set listen port for OpenACS |
OACS_IMAGE_NAME | alt-s6-openacs | Set OpenACS image name |
OACS_IMAGE_TAG | oacs-5-10 | Set OpenACS image tag |
oacs_ipaddress* | 0.0.0.0 | Set listen address for OpenACS |
OACS_LISTEN_PORT | 8080 | Set http listen port, example 8080 |
OACS_REPOSITORY | oupfiz5 | Set OpenACS repository name |
PGDATABASE | openacs | Database name |
PGHOST | postgres | Database host name |
PGPASWORD | testing | Database user password |
PGPORT | 5432 | Database port |
PGUSER | openacs | Database user name |
POSTGRES_DB | ${PGDATABASE} | Set postgres db name for docker image |
POSTGRES_PASSWORD | ${PGPASSWORD} | Set postgres db password for docker image |
POSTGRES_USER | ${PGUSER} | Set postgres db user for docker image |
POSTGRES_REPOSITORY | postgres | Set default postgres repository |
POSTGRES_TAG | 14.1-alpine | Set default postgres tag |
TZ | UTC | Set timezone, example Europe/Moscow |
- setting these variables as environment variables with the "oacs_" prefix (suitable for e.g. docker setups for
defaultConfig
in NS_CONF (see naviserver commit).
All options have predifined values and store in .env
file.
Setting these variables as environment variables with the "oacs_" prefix (suitable for e.g. docker setups for defaultConfig
in NS_CONF (see naviserver commit).
Code example from NaviServer configuration file is:
...
# All default variables in defaultConfig can be overloaded by
# 1) setting these variables in this file (highest precedence)
# 2) setting these variables as environment variables with
# the "oacs_" prefix (suitable for e.g. docker setups)
# 3) set the variables from the default values.
#
set defaultConfig {
hostname localhost
ipaddress 127.0.0.1
httpport 8000
httpsport ""
server "openacs"
serverroot /var/www/$server
logroot $serverroot/log/
homedir /usr/local/ns
bindir $homedir/bin
db_name $server
db_user $server
db_host localhost
db_port ""
db_password "testing"
}
...
Environment variables from .env file are:
...
oacs_httpport='8000'
oacs_db_user="${PGUSER}"
oacs_db_passwod="${PGPASSWORD}"
oacs_db_name="${PGDATABASE}"
oacs_db_host="${PGHOST}"
oacs_db_port="${PGPORT}"
oacs_ipaddress='0.0.0.0'
...
OACS_LISTEN_PORT
set the http listen port for the openacs. In this case the OpenACS is accessible by URL http://localhost:8070.
OACS_LISTEN_PORT=8070 docker compose up
Docker-compose uses the following variables for pulling OpenACS image from docker hub:
- OACS_REPOSITORY
- OACS_IMAGE_NAME
- OACS_IMAGE_TAG
NS_CONF
- configuration file. Default value is /usr/local/ns/conf/openacs-config.tcl
-
Put the configuration file to
rootfs/usr/local/ns/conf
-
Run docker compose
NS_CONF="/usr/local/ns/conf/my-config.tcl" docker-compose up
Docker-compose uses the following variables for pulling postgres image from docker hub:
- POSTGRES_REPOSITORY
- POSTGRES_TAG
PGHOST
set the database hostname for the openacs. By default it has name of docker-compose database service - postgres.
PGHOST=foo docker compose up
PGDATABASE
set the database name for the openacs. By default it has name of docker-compose database service - openacs.
PGDATABASE=foo docker compose up
PGUSER
set the database username for the openacs and postgres.
PGUSER=foouser docker compose up
PGPASSWORD
set the database user password for the openacs and postgres.
PGPASSWORD=foopass docker compose up
POSTGRES_TAG
set the docker image tag for official postgres. Pay attention - some openacs version can use only correspond version of postgres.
POSTGRES_TAG="14.1-alpine" docker-compose up
Set the timezone for the containers, defaults to UTC. To set the timezone set the desired timezone with the variable TZ. Useful for setup correct time in logging.
TZ="Europe/Moscow" docker compose up
For build and push docker images we use GitHub Actions workflow.
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 alt-s6-openacs_openacs_1 /bin/bash
docker exec -it alt-s6-openacs_postgres_1 /bin/bash