added container file and entrypoint scripts

This commit is contained in:
Paul Wilde 2021-08-10 16:53:21 +01:00
parent 9b0d8c081a
commit 3653946225
6 changed files with 29 additions and 2 deletions

3
.gitignore vendored
View file

@ -1,2 +1 @@
config/config.ini
config/services.ini
config

View file

@ -2,6 +2,14 @@ FROM php:7.4-apache
COPY src/ /var/www/html/
COPY ./entrypoint.sh /
RUN chmod +x /entrypoint.sh
# Use the default production configuration
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
RUN a2enmod rewrite
EXPOSE 80
ENTRYPOINT ["/entrypoint.sh"]

9
compose.yml Normal file
View file

@ -0,0 +1,9 @@
version: '3.3'
services:
davdiscover:
container_name: davdiscover
ports:
- '8010:80'
volumes:
- './config:/var/www/html/config'
image: pswilde/davdiscover

6
docker-run.sh Normal file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
podman run --name davdiscover \
--rm \
-p "8010:80" \
-v ./config:/var/www/html/config \
pswilde/davdiscover

3
entrypoint.sh Normal file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
cp /var/www/html/sample-config/* /var/www/html/config/
exec apache2-foreground

View file

@ -29,6 +29,7 @@ class Init {
// YOU REALLY SHOULD HAVE YOUR OWN CONFIG FILE!!!
if (!file_exists($config)) {
echo copy(Core::root_dir()."/sample-config/services.sample.ini", $config);
$config = Core::root_dir()."/sample-config/config.sample.ini";
}
@ -39,6 +40,7 @@ class Init {
// YOU REALLY SHOULD HAVE YOUR OWN SERVICES FILE!!!
if (!file_exists($services)) {
echo copy(Core::root_dir()."/sample-config/services.sample.ini", $services);
$services = Core::root_dir()."/sample-config/services.sample.ini";
}