summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2023-11-02 23:59:35 +0300
committerAndrew Dolgov <[email protected]>2023-11-02 23:59:35 +0300
commit9885aa665e7244d366de53a95b4114b14f76ff50 (patch)
treecb72b9a6c43ed8f97731b54fe7bb95b9cd86763b
parent879ee8b1ae6aef4a59821317236c4e3740f96f14 (diff)
add dev compose stuff
-rw-r--r--.docker/app/startup.sh20
-rw-r--r--.env-dist15
-rw-r--r--.gitignore2
-rw-r--r--docker-compose.yml35
4 files changed, 63 insertions, 9 deletions
diff --git a/.docker/app/startup.sh b/.docker/app/startup.sh
index 6c5f721..3c57f25 100644
--- a/.docker/app/startup.sh
+++ b/.docker/app/startup.sh
@@ -18,15 +18,17 @@ export PGPASSWORD=$DB_PASS
[ ! -e /var/www/html/index.php ] && cp ${SCRIPT_ROOT}/index.php /var/www/html
-if [ ! -d $DST_DIR ]; then
- rsync -a \
- $SRC_DIR/ $DST_DIR/
-else
- rsync -a --delete \
- --exclude sessions \
- --exclude lib/fonts \
- --exclude db \
- $SRC_DIR/ $DST_DIR/
+if [ -z $SKIP_RSYNC_ON_STARTUP ]; then
+ if [ ! -d $DST_DIR ]; then
+ rsync -a \
+ $SRC_DIR/ $DST_DIR/
+ else
+ rsync -a --delete \
+ --exclude sessions \
+ --exclude lib/fonts \
+ --exclude db \
+ $SRC_DIR/ $DST_DIR/
+ fi
fi
if [ ! -e $DST_DIR/index.php ]; then
diff --git a/.env-dist b/.env-dist
new file mode 100644
index 0000000..6cd60e3
--- /dev/null
+++ b/.env-dist
@@ -0,0 +1,15 @@
+# Copy this file to .env before building the container.
+# Put any local modifications here.
+
+# Calibre library base directory (mounts to /books)
+BOOKS_DIR=/home/user/calibre/Books
+
+# Default user to create (if it doesn't exist)
+EPUBE_ADMIN_USER=admin
+EPUBE_ADMIN_PASS=password
+
+# bind exposed port to 127.0.0.1 by default in case reverse proxy is used.
+# if you plan to run the container standalone and need origin port exposed
+# use next HTTP_PORT definition (or remove "127.0.0.1:").
+HTTP_PORT=127.0.0.1:8280
+#HTTP_PORT=8280
diff --git a/.gitignore b/.gitignore
index cb03faf..4d77da3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
+/.env
+/docker-compose.override.yml
/.app_is_ready
/config.php
/lib/fonts/*.ttf
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..5f08922
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,35 @@
+#
+# simplified compose FOR LOCAL DEVELOPMENT.
+#
+
+version: '3'
+
+services:
+ app:
+ image: cthulhoo/the-epube-fpm-static:latest
+ environment:
+ SKIP_RSYNC_ON_STARTUP: true
+ build:
+ dockerfile: .docker/app/Dockerfile
+ context: .
+ restart: unless-stopped
+ env_file:
+ - .env
+ volumes:
+ - .:/var/www/html/books
+ - ${BOOKS_DIR}:/books:ro
+
+ web-nginx:
+ image: cthulhoo/the-epube-web-nginx:latest
+ build:
+ dockerfile: .docker/web-nginx/Dockerfile
+ context: .
+ restart: unless-stopped
+ env_file:
+ - .env
+ ports:
+ - ${HTTP_PORT}:80
+ volumes:
+ - .:/var/www/html/books:ro
+ depends_on:
+ - app