forked from hazza/resourcespace-docker
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
490dd3bbf8 | ||
![]() |
629d034627 | ||
![]() |
4d34785299 | ||
![]() |
eee2dcb59d | ||
![]() |
e53595e711 | ||
![]() |
7102ce971f | ||
![]() |
f458dda093 | ||
![]() |
4fc6fc0c4f |
3
.env
3
.env
@@ -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
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.sh text eol=lf
|
118
Dockerfile
118
Dockerfile
@@ -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
0
config.php
Normal file
4
db.env
4
db.env
@@ -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
|
@@ -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:
|
||||
filestore:
|
||||
|
10
entrypoint.sh
Normal file
10
entrypoint.sh
Normal 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
|
Reference in New Issue
Block a user