mirror of
https://github.com/standardebooks/web.git
synced 2025-07-16 03:16:36 -04:00
We were generating the key in the Dockerfile, but then mounting the host’s web directory, which “obscured” (to quote the Docker docs) the directory in the container. We can move key generation to the container entrypoint, but only call it if the key doesn’t already exist to save time on container teardown / restart.
19 lines
896 B
Bash
Executable file
19 lines
896 B
Bash
Executable file
#!/bin/sh
|
|
|
|
if [ ! -f /standardebooks.org/web/config/ssl/standardebooks.test.crt ]; then
|
|
openssl req -x509 -nodes -days 99999 -newkey rsa:4096 -subj "/CN=standardebooks.test" -keyout /standardebooks.org/web/config/ssl/standardebooks.test.key -sha256 -out /standardebooks.org/web/config/ssl/standardebooks.test.crt
|
|
fi
|
|
|
|
cd /standardebooks.org/web
|
|
composer install
|
|
|
|
ln -s /standardebooks.org/web/config/apache/standardebooks.test.conf /etc/apache2/sites-available/
|
|
ln -s /standardebooks.org/web/config/php/fpm/standardebooks.org.ini /etc/php/*/cli/conf.d/
|
|
ln -s /standardebooks.org/web/config/php/fpm/standardebooks.org.ini /etc/php/*/fpm/conf.d/
|
|
ln -s /standardebooks.org/web/config/php/fpm/standardebooks.test.conf /etc/php/*/fpm/pool.d/
|
|
a2ensite standardebooks.test
|
|
/etc/init.d/apache2 start
|
|
service php7.4-fpm restart
|
|
|
|
# Keep the server available by holding open the container
|
|
tail -f /dev/null
|