Skip to content

Latest commit

 

History

History
86 lines (58 loc) · 1.52 KB

README.md

File metadata and controls

86 lines (58 loc) · 1.52 KB

Using purl.brain-bican.org.git in docker

Installation

  • These steps were successfully tested on:
    • macOS (10.15.3), ubuntu (22.04)
    • Docker (19.03.5, 20.10.20)

Prerequisites

The following tools should be available on the system.

  • docker

AWS S3 Credentials

Prepare The s3 credential file (s3cfg) needed for LogRotate. It should like so:

[default]
access_key = REPLACE_ME
secret_key = REPLACE_ME

Clone the repository

git clone https://github.com/brain-bican/purl.brain-bican.org.git

Build Purl Image

cd purl.brain-bican.org
docker build -f docker/Dockerfile -t purl:latest .
docker image list | grep purl 

Launch Container

Run interactively and access the web server using http://localhost. Be sure to specify the absolute path to s3 credentials (s3cfg).

docker run --name purl -v REPLACE_ME:/opt/credentials/s3cfg -p 80:80 -it purl:latest /bin/bash

sudo cat /opt/credentials/s3cfg   # Make sure crendetials were mounted properly
ps -ef                            # Make sure apache is running

Cleanup

Stop Container.

docker stop purl

Delete Container.

docker rm -f purl

Delete Image.

docker image rm purl:latest

Test Inside Container

Run tests and safe-update.

cd /var/www/purl.brain-bican.org
sudo make all test
sudo make safe-update

Test LogRotate. Use -f option to force log rotation.

sudo cat /opt/credentials/s3cfg
sudo logrotate -v -f /etc/logrotate.d/apache2