8 Commits
main ... main

Author SHA1 Message Date
jbrooke-montala
490dd3bbf8 Merge pull request #9 from cevans-montala/patch-1
Update docker-compose.yaml
2025-08-21 15:18:31 +01:00
Chris
629d034627 Update docker-compose.yaml
Remove unneeded entry under volumes
2025-08-21 15:07:41 +01:00
jbrooke-montala
4d34785299 Merge pull request #7 from cevans-montala/main
Add .gitattributes file to force Unix line endings for entrypoint.sh
2025-08-05 14:26:02 +01:00
Chris Evans
eee2dcb59d Add .gitattributes file to force Unix line endings for entrypoint.sh 2025-08-04 16:23:36 +01:00
jbrooke-montala
e53595e711 Merge pull request #5 from cevans-montala/main
Added entrypoint.sh script to start Apache and cron and made Dockerfile run it after building.
2025-07-28 16:33:42 +01:00
Chris Evans
7102ce971f Update Dockerfile to pull ResourceSpace 10.6 2025-07-28 14:47:23 +01:00
Chris Evans
f458dda093 Only map config.php rather than whole include folder 2025-07-28 14:46:41 +01:00
Chris Evans
4fc6fc0c4f Add entrypoint.sh script to start Apache and cron and make Dockerfile run it after building 2025-07-23 11:39:44 +01:00
7 changed files with 62 additions and 90 deletions

3
.env
View File

@@ -1,3 +0,0 @@
RS_PUBLISHED_DOMAIN=dam.internal.yel.or.id
RS_SERVERADMIN=hendra@yel.or.id
DNS_CLOUDFLARE_API_TOKEN=3WedMWHhoDPxge5yMPJgQPFhRXCTp6zpasTIlaIu

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
*.sh text eol=lf

View File

@@ -4,86 +4,60 @@ LABEL org.opencontainers.image.authors="Montala Ltd"
ENV DEBIAN_FRONTEND="noninteractive"
ARG RS_PUBLISHED_DOMAIN
ARG RS_SERVERADMIN
ARG DNS_CLOUDFLARE_API_TOKEN
RUN apt-get update && apt-get install -y \
nano \
imagemagick \
apache2 \
git \
ghostscript \
antiword \
poppler-utils \
libimage-exiftool-perl \
cron \
postfix \
wget \
php \
php-apcu \
php-curl \
php-dev \
php-gd \
php-intl \
php-mysqlnd \
php-mbstring \
php-zip \
libapache2-mod-php \
ffmpeg \
libopencv-dev \
python3-opencv \
python3 \
certbot \
python3-certbot-dns-cloudflare \
python3-certbot-apache \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
nano \
imagemagick \
apache2 \
subversion \
ghostscript \
antiword \
poppler-utils \
libimage-exiftool-perl \
cron \
postfix \
wget \
php \
php-apcu \
php-curl \
php-dev \
php-gd \
php-intl \
php-mysqlnd \
php-mbstring \
php-zip \
libapache2-mod-php \
ffmpeg \
libopencv-dev \
python3-opencv \
python3 \
python3-pip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN sed -i -e "s/upload_max_filesize\s*=\s*2M/upload_max_filesize = 100M/g" /etc/php/8.3/apache2/php.ini \
&& sed -i -e "s/post_max_size\s*=\s*8M/post_max_size = 100M/g" /etc/php/8.3/apache2/php.ini \
&& sed -i -e "s/max_execution_time\s*=\s*30/max_execution_time = 300/g" /etc/php/8.3/apache2/php.ini \
&& sed -i -e "s/memory_limit\s*=\s*128M/memory_limit = 4G/g" /etc/php/8.3/apache2/php.ini
&& sed -i -e "s/post_max_size\s*=\s*8M/post_max_size = 100M/g" /etc/php/8.3/apache2/php.ini \
&& sed -i -e "s/max_execution_time\s*=\s*30/max_execution_time = 300/g" /etc/php/8.3/apache2/php.ini \
&& sed -i -e "s/memory_limit\s*=\s*128M/memory_limit = 1G/g" /etc/php/8.3/apache2/php.ini
RUN mkdir -p ~/.secrets/certbot
RUN printf "dns_cloudflare_api_token=$DNS_CLOUDFLARE_API_TOKEN" >> ~/.secrets/certbot/cloudflare.ini
RUN chmod 600 ~/.secrets/certbot/cloudflare.ini
RUN printf "<VirtualHost *:80>\n\
\tServerName $RS_PUBLISHED_DOMAIN\n\
\tServerAdmin $RS_SERVERADMIN\n\
\tDocumentRoot /var/www/html\n\
\n\
\tErrorLog ${APACHE_LOG_DIR}/$RS_PUBLISHED_DOMAIN.error.log\n\
\tCustomLog ${APACHE_LOG_DIR}/$RS_PUBLISHED_DOMAIN.access.log combined\n\
</VirtualHost>\n\
\n\
<Directory /var/www/>\n\
RUN printf '<Directory /var/www/>\n\
\tOptions FollowSymLinks\n\
</Directory>\n"\
>> /etc/apache2/sites-available/$RS_PUBLISHED_DOMAIN.conf
RUN a2ensite $RS_PUBLISHED_DOMAIN.conf
</Directory>\n'\
>> /etc/apache2/sites-enabled/000-default.conf
ADD cronjob /etc/cron.daily/resourcespace
RUN rm -rf var/www/html/*
WORKDIR /var/www/html
RUN git clone --single-branch --branch 10.6 https://git.internal.yel.or.id/hazza/resourcespace . \
&& mkdir -p filestore \
&& chmod 777 filestore \
&& chmod -R 777 include/
RUN rm -f index.html \
&& svn co -q https://svn.resourcespace.com/svn/rs/releases/10.6 . \
&& mkdir -p filestore \
&& chmod 777 filestore \
&& chmod -R 777 include/
RUN certbot run -i apache \
-a dns-cloudflare --dns-cloudflare-credentials ~/.secrets/certbot/cloudflare.ini \
--non-interactive --agree-tos --no-eff-email -m $RS_SERVERADMIN \
-d $RS_PUBLISHED_DOMAIN
CMD apachectl -D FOREGROUND
# Copy custom entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Start both cron and Apache
CMD ["/entrypoint.sh"]

0
config.php Normal file
View File

4
db.env
View File

@@ -1,4 +1,4 @@
MYSQL_PASSWORD=DAMSedapMalamIX3
MYSQL_ROOT_PASSWORD=DAMasterSedapMalamIX3
MYSQL_PASSWORD=change-me
MYSQL_ROOT_PASSWORD=change-me
MYSQL_DATABASE=resourcespace
MYSQL_USER=resourcespace_rw

View File

@@ -1,26 +1,18 @@
services:
resourcespace:
build:
context: .
args:
- RS_PUBLISHED_DOMAIN=${RS_PUBLISHED_DOMAIN}
- RS_SERVERADMIN=${RS_SERVERADMIN}
- DNS_CLOUDFLARE_API_TOKEN=${DNS_CLOUDFLARE_API_TOKEN}
build: .
container_name: resourcespace
restart: unless-stopped
depends_on:
- mariadb
volumes:
- usrhome:/root
- include:/var/www/html/include
- filestore:/var/www/html/filestore
- ./testdir:/srv/storage/testdir
- ./config.php:/var/www/html/include/config.php
networks:
- frontend
- backend
ports:
- "80:80"
- "443:443"
mariadb:
image: mariadb
@@ -38,7 +30,5 @@ networks:
backend:
volumes:
usrhome:
mariadb:
include:
filestore:

10
entrypoint.sh Normal file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
# Start cron service
service cron start
# Ensure daily cron jobs are executable
chmod +x /etc/cron.daily/*
# Start Apache in the foreground (keeps the container alive)
apachectl -D FOREGROUND