Compare commits
4 Commits
77ae65c2bd
...
525c6a47a6
| Author | SHA1 | Date | |
|---|---|---|---|
| 525c6a47a6 | |||
| 5af898a702 | |||
| 7ee5437f8a | |||
| fa7af9d5c7 |
29
Dockerfile
29
Dockerfile
@@ -11,14 +11,13 @@ RUN apt update && \
|
||||
libjpeg-dev \
|
||||
libicu-dev \
|
||||
libpq-dev \
|
||||
libsqlite3-dev \
|
||||
sqlite3 \
|
||||
curl \
|
||||
git \
|
||||
cron \
|
||||
nano
|
||||
|
||||
RUN service start cron
|
||||
RUN service enable cron
|
||||
|
||||
RUN docker-php-ext-configure gd --with-jpeg
|
||||
RUN docker-php-ext-configure zip
|
||||
@@ -42,26 +41,38 @@ RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" &&
|
||||
RUN curl -sS https://get.symfony.com/cli/installer | bash && \
|
||||
mv /root/.symfony5/bin/symfony /usr/local/bin/symfony
|
||||
|
||||
RUN cd /var/www/html
|
||||
RUN git clone https://gitea.rkprather.com/ryan/sermon-notes.git ./
|
||||
ARG CACHEBURST=1
|
||||
ARG BRANCH=master
|
||||
|
||||
WORKDIR /var/www/html
|
||||
RUN git clone -b ${BRANCH} --single-branch https://gitea.rkprather.com/ryan/sermon-notes.git ./
|
||||
RUN git config --global --add safe.directory /var/www/html
|
||||
|
||||
RUN mv 000-default.conf /etc/apache2/sites-available/
|
||||
|
||||
RUN echo "20 1 * * 6 root cd /var/www/html && /usr/local/bin/php bin/console app:get-audio > /var/log/sermon-notes.log 2>&1" > /etc/cron.d/get-audio
|
||||
RUN echo "20 1 * * 6 root cd /var/www/html && /usr/local/bin/php bin/console app:get-audio > /proc/1/fd/1 2>&1" > /etc/cron.d/get-audio
|
||||
RUN chmod 644 /etc/cron.d/get-audio
|
||||
RUN crontab /etc/cron.d/get-audio
|
||||
|
||||
RUN COMPOSER_ALLOW_SUPERUSER=1 composer install --no-scripts --no-dev --optimize-autoloader
|
||||
RUN /usr/local/bin/php bin/console asset-map:compile
|
||||
RUN mkdir /data
|
||||
|
||||
RUN mkdir /var/www/html/var/cache
|
||||
RUN mkdir /var/www/html/var/log
|
||||
RUN mkdir -p /var/www/html/var/cache
|
||||
RUN mkdir -p /var/www/html/var/log
|
||||
|
||||
RUN chown -R 33:33 /var/www/html /data
|
||||
RUN find /var/www/html -type d -exec chmod 755 '{}' \;
|
||||
RUN find /var/www/html -type f -exec chmod 644 '{}' \;
|
||||
RUN chmod 755 /data
|
||||
RUN chmod 644 /data/*
|
||||
RUN a2enmod rewrite setenvif headers
|
||||
|
||||
COPY prod.env /var/www/html/.env
|
||||
RUN /usr/local/bin/php bin/console importmap:install
|
||||
RUN /usr/local/bin/php bin/console asset-map:compile
|
||||
RUN rm /var/www/html/.env
|
||||
RUN chmod +x /var/www/html/bin/entrypoint.sh
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
ENTRYPOINT ["/var/www/html/bin/entrypoint.sh"]
|
||||
CMD ["apache2-foreground"]
|
||||
|
||||
@@ -28,11 +28,12 @@ This was my first publicly available docker container so I did not realize what
|
||||
5. [`compose.shared-db.yml`](https://gitea.rkprather.com/ryan/sermon-notes/raw/branch/main/docker/compose.shared-db.yml) - compose file with no database image because you are planning on using an existing database container or bare metal server
|
||||
4. Pull the image `docker pull gitea.rkprather.com/ryan/sermon-notes:latest`
|
||||
5. **NOTE: IF UPGRADING SKIP THIS STEP!!!** - Run the setup script, this will setup your .env file so that when you start the container everything will be where it is supposed to be.
|
||||
- `docker run --rm -it -v ${PWD}/.env:/var/www/html/.env gitea.rkprather.com/ryan/sermon-notes:latest /var/www/html/setup.php --{database-type} {--shared}`
|
||||
- `docker run --rm -it -v ${PWD}/.env:/var/www/html/.env gitea.rkprather.com/ryan/sermon-notes:latest php /var/www/html/setup.php --{database-type} {--shared}`
|
||||
- `{database-type}` = `sqlite`, `mysql`, `mariadb`, or `pgsql`
|
||||
- If you intend on this being connected to a shared database make sure that you specify `--shared`.
|
||||
6. Start the container with compose `docker compose up -d`
|
||||
7. **NOTE: IF UPGRADING SKIP THIS STEP!!!** Run `docker exec -it sermon-notes /var/www/html/install.php`. This will run the `php composer` to populate the database with all the desired reference material.
|
||||
7. **NOTE: IF UPGRADING SKIP THIS STEP!!!** Run `docker exec -it sermon-notes php /var/www/html/install.php`. This will run the `php composer` to populate the database with all the desired reference material.
|
||||
- NOTE: You will see deprecation warnings, you can ignore these
|
||||
8. Once complete you have a running system that you can navigate to in your browser with `http://{ip}:{port}`|`http://{hostname}:{port}`. Then you just need to register for an account. The first account that is created is made an admin so that you can access the `Reference Editor` and update any reference material if necessary.
|
||||
|
||||
## Operation
|
||||
|
||||
50
install.php
50
install.php
@@ -3,26 +3,26 @@
|
||||
<?php
|
||||
|
||||
print "Updating packages and compiling assets".PHP_EOL;
|
||||
`COMPOSE_ALLOW_SUPERUSER=1 composer update`;
|
||||
//`symfony console asset-map:compile`;
|
||||
shell_exec("COMPOSE_ALLOW_SUPERUSER=1 composer update");
|
||||
//`symfony console asset-map:compile");
|
||||
|
||||
print "Creating database schema".PHP_EOL;
|
||||
`symfony console doctrine:database:create`;
|
||||
shell_exec("symfony console doctrine:database:create");
|
||||
|
||||
print "Updating migrations and setting permissions for data folder".PHP_EOL;
|
||||
`symfony console doctrine:migrations:migrate --no-interaction`;
|
||||
shell_exec("symfony console doctrine:migrations:migrate --no-interaction");
|
||||
|
||||
`chown -R www-data:www-data /data`;
|
||||
shell_exec("chown -R www-data:www-data /data");
|
||||
|
||||
// import reference material
|
||||
|
||||
print "Importing Bible and Eccumenical Creeds".PHP_EOL;
|
||||
`symfony console app:ingest-bible /var/www/html/references/esv-bible`;
|
||||
`symfony console app:import-ref /var/www/html/references/creeds/Apostles 'Apostles Creed' creed apc`;
|
||||
`symfony console app:import-ref /var/www/html/references/creeds/Athanasian 'Athanasian Creed' creed ath`;
|
||||
`symfony console app:import-ref /var/www/html/references/creeds/Chalcedon 'Definition of Chalcedon' creed dc`;
|
||||
`symfony console app:import-ref /var/www/html/references/creeds/French 'French Confession' creed fc`;
|
||||
`symfony console app:import-ref /var/www/html/references/creeds/Nicene 'Nicene Creed' creed nc`;
|
||||
shell_exec("symfony console app:ingest-bible /var/www/html/references/esv-bible");
|
||||
shell_exec("symfony console app:import-ref /var/www/html/references/creeds/Apostles 'Apostles Creed' creed apc");
|
||||
shell_exec("symfony console app:import-ref /var/www/html/references/creeds/Athanasian 'Athanasian Creed' creed ath");
|
||||
shell_exec("symfony console app:import-ref /var/www/html/references/creeds/Chalcedon 'Definition of Chalcedon' creed dc");
|
||||
shell_exec("symfony console app:import-ref /var/www/html/references/creeds/French 'French Confession' creed fc");
|
||||
shell_exec("symfony console app:import-ref /var/www/html/references/creeds/Nicene 'Nicene Creed' creed nc");
|
||||
|
||||
$dutchStandards = (
|
||||
strtolower(
|
||||
@@ -32,9 +32,9 @@ $dutchStandards = (
|
||||
|
||||
if ($dutchStandards) {
|
||||
print "Importing Dutch Standards".PHP_EOL;
|
||||
`symfony console app:import-ref /var/www/html/references/bc Belgic belgic BC{\$ndx}`;
|
||||
`symfony console app:import-heidelberg`;
|
||||
`symfony console app:import-canons-of-dort`;
|
||||
shell_exec("symfony console app:import-ref /var/www/html/references/bc Belgic belgic BC{\$ndx}");
|
||||
shell_exec("symfony console app:import-heidelberg");
|
||||
shell_exec("symfony console app:import-ref /var/www/html/references/cd Canons cd CD");
|
||||
}
|
||||
|
||||
$westminsterStandards = (
|
||||
@@ -45,9 +45,9 @@ $westminsterStandards = (
|
||||
|
||||
if ($westminsterStandards) {
|
||||
print "Importing Westminster Standards".PHP_EOL;
|
||||
`symfony console app:import-ref /var/www/html/references/wcf 'Westminster Confession' wcf WCF{\$ndx}`;
|
||||
`symfony console app:import-ref /var/www/html/references/wsc 'Westminster Shorter' wsc WSC{\$ndx}`;
|
||||
`symfony console app:import-wlc /var/www/html/references/wlc 'Westminster Larger' wlc WLC{\$ndx}`;
|
||||
shell_exec("symfony console app:import-ref /var/www/html/references/wcf 'Westminster Confession' wcf WCF{\$ndx}");
|
||||
shell_exec("symfony console app:import-ref /var/www/html/references/wsc 'Westminster Shorter' wsc WSC{\$ndx}");
|
||||
shell_exec("symfony console app:import-ref /var/www/html/references/wlc 'Westminster Larger' wlc WLC{\$ndx}");
|
||||
}
|
||||
|
||||
$helveticConfessions = (
|
||||
@@ -58,8 +58,8 @@ $helveticConfessions = (
|
||||
|
||||
if ($helveticConfessions) {
|
||||
print "Importing Helvitic standards".PHP_EOL;
|
||||
`symfony console app:import-ref /var/www/html/references/fhc 'First Helvetic Confession' 1hc 1HC{\$ndx}`;
|
||||
`symfony console app:import-ref /var/www/html/references/shc 'Second Helvetic Confession' 2hc 2HC{\$ndx}`;
|
||||
shell_exec("symfony console app:import-ref /var/www/html/references/fhc 'First Helvetic Confession' 1hc 1HC{\$ndx}");
|
||||
shell_exec("symfony console app:import-ref /var/www/html/references/shc 'Second Helvetic Confession' 2hc 2HC{\$ndx}");
|
||||
}
|
||||
|
||||
$miscStandards = (
|
||||
@@ -70,12 +70,12 @@ $miscStandards = (
|
||||
|
||||
if ($miscStandards) {
|
||||
print "Importing misc standards".PHP_EOL;
|
||||
`symfony console app:import-ref /var/www/html/references/39a 'Thirty-Nine Articles' 39a 39A{\$ndx}`;
|
||||
`symfony console app:import-ref /var/www/html/references/ac 'Augsberg Confession' agc AGC{\$ndx}`;
|
||||
`symfony console app:import-ref /var/www/html/references/lbc 'London Baptist Confession' lbc LBC{\$ndx}`;
|
||||
`symfony console app:import-ref /var/www/html/references/lsc 'Luther\'s Small Catechism' lsc LSC`;
|
||||
`symfony console app:import-ref /var/www/html/references/llc 'Luther\'s Large Catechism' llc LLC`;
|
||||
`symfony console app:import-ref /var/www/html/references/sd 'Savoy Declaration' sd SD{\$ndx}`;
|
||||
shell_exec("symfony console app:import-ref /var/www/html/references/39a 'Thirty-Nine Articles' 39a 39A{\$ndx}");
|
||||
shell_exec("symfony console app:import-ref /var/www/html/references/ac 'Augsberg Confession' agc AGC{\$ndx}");
|
||||
shell_exec("symfony console app:import-ref /var/www/html/references/lbc 'London Baptist Confession' lbc LBC{\$ndx}");
|
||||
shell_exec("symfony console app:import-ref /var/www/html/references/lsc 'Luther\'s Small Catechism' lsc LSC");
|
||||
shell_exec("symfony console app:import-ref /var/www/html/references/llc 'Luther\'s Large Catechism' llc LLC");
|
||||
shell_exec("symfony console app:import-ref /var/www/html/references/sd 'Savoy Declaration' sd SD{\$ndx}");
|
||||
}
|
||||
|
||||
print "Sermon Notes Ready".PHP_EOL.PHP_EOL;
|
||||
|
||||
@@ -144,6 +144,10 @@ class IngestReferenceCommand extends Command
|
||||
$ref->setContent($md);
|
||||
$ref->setName($this->name);
|
||||
$ref->setType($this->type);
|
||||
|
||||
if ($this->type == 'cd') {
|
||||
$label = substr(basename($file), 0, -3);
|
||||
}
|
||||
$ref->setLabel($label);
|
||||
|
||||
$this->io->success("Ingested {$this->name} as {$this->type}:{$label}");
|
||||
|
||||
Reference in New Issue
Block a user