Browse Source

split build-related stuff into src/

Andrew Dolgov 8 months ago
parent
commit
98d65cd865

+ 0 - 14
docker-compose.yml

@@ -15,12 +15,6 @@ services:
 
   app:
     image: cthulhoo/ttrss-fpm-pgsql-static
-#    build: 
-#      context:
-#        ./app
-#      args:
-#        - OWNER_UID=${OWNER_UID}
-#        - OWNER_GID=${OWNER_GID}
     restart: unless-stopped
     environment:
       - DB_TYPE=pgsql
@@ -38,12 +32,6 @@ services:
 
   updater:
     image: cthulhoo/ttrss-fpm-pgsql-static
-#    build: 
-#      context:
-#        ./app
-#      args:
-#        - OWNER_UID=${OWNER_UID}
-#        - OWNER_GID=${OWNER_GID}
     restart: unless-stopped
     environment:
       - DB_TYPE=pgsql
@@ -63,7 +51,6 @@ services:
 
   web:
     image: cthulhoo/ttrss-web
-    #build: ./web
     restart: unless-stopped
     ports:
       - ${HTTP_PORT}:2015
@@ -74,7 +61,6 @@ services:
 
 #  web-ssl:
 #    image: cthulhoo/ttrss-web-ssl
-#    build: ./web-ssl
 #    restart: unless-stopped
 #    environment:
 #      - CADDYPATH=/certs

+ 0 - 0
app/Dockerfile → src/app/Dockerfile


+ 26 - 0
src/app/build-prepare.sh

@@ -0,0 +1,26 @@
+#!/bin/sh
+
+DST_DIR=/src/tt-rss
+SRC_REPO=https://git.tt-rss.org/fox/tt-rss.git
+
+if [ ! -d $DST_DIR ]; then
+	mkdir -p $DST_DIR
+	git clone $SRC_REPO $DST_DIR
+else
+	cd $DST_DIR && \
+		git config core.filemode false && \
+		git pull origin master
+fi
+
+if [ ! -d $DST_DIR/plugins.local/nginx_xaccel ]; then
+	git clone https://git.tt-rss.org/fox/ttrss-nginx-xaccel.git $DST_DIR/plugins.local/nginx_xaccel
+else
+	cd $DST_DIR/plugins.local/nginx_xaccel && \
+		git config core.filemode false && \
+	  	git pull origin master
+fi
+
+mkdir -p /var/www
+addgroup -g $OWNER_GID app 
+adduser -D -h /var/www/html -G app -u $OWNER_UID app
+

+ 0 - 0
app/index.php → src/app/index.php


+ 0 - 0
app/startup.sh → src/app/startup.sh


+ 0 - 0
app/updater.sh → src/app/updater.sh


+ 94 - 0
src/docker-compose.yml

@@ -0,0 +1,94 @@
+version: '3'
+
+# set database password in .env
+# please don't use quote (') or (") symbols in variables
+
+services:
+  db:
+    image: postgres:12-alpine
+    restart: unless-stopped
+    volumes:
+      - db:/var/lib/postgresql/data
+    environment:    
+      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
+      - POSTGRES_USER=${POSTGRES_USER}
+
+  app:
+    image: cthulhoo/ttrss-fpm-pgsql-static
+    build: 
+      context:
+        ./app
+      args:
+        - OWNER_UID=${OWNER_UID}
+        - OWNER_GID=${OWNER_GID}
+    restart: unless-stopped
+    environment:
+      - DB_TYPE=pgsql
+      - DB_HOST=db
+      - DB_NAME=${POSTGRES_USER}
+      - DB_USER=${POSTGRES_USER}
+      - DB_PASS=${POSTGRES_PASSWORD}
+      - OWNER_UID=${OWNER_UID}
+      - OWNER_GID=${OWNER_GID}
+      - SELF_URL_PATH=${SELF_URL_PATH}
+    volumes:
+      - app:/var/www/html
+    depends_on:
+      - db
+
+  updater:
+    image: cthulhoo/ttrss-fpm-pgsql-static
+    build: 
+      context:
+        ./app
+      args:
+        - OWNER_UID=${OWNER_UID}
+        - OWNER_GID=${OWNER_GID}
+    restart: unless-stopped
+    environment:
+      - DB_TYPE=pgsql
+      - DB_HOST=db
+      - DB_NAME=${POSTGRES_USER}
+      - DB_USER=${POSTGRES_USER}
+      - DB_PASS=${POSTGRES_PASSWORD}
+      - OWNER_UID=${OWNER_UID}
+      - OWNER_GID=${OWNER_GID}
+      - SELF_URL_PATH=${SELF_URL_PATH}
+    volumes:
+      - app:/var/www/html
+    depends_on:
+      - app
+    user: app
+    command: /updater.sh
+
+  web:
+    image: cthulhoo/ttrss-web
+    build: ./web
+    restart: unless-stopped
+    ports:
+      - ${HTTP_PORT}:2015
+    volumes:
+      - app:/var/www/html:ro
+    depends_on:
+      - app
+
+  web-ssl:
+    image: cthulhoo/ttrss-web-ssl
+    build: ./web-ssl
+    restart: unless-stopped
+    environment:
+      - CADDYPATH=/certs
+      - HTTP_HOST=${HTTP_HOST}
+    ports:
+      - 80:80
+      - 443:443
+    volumes:
+      - app:/var/www/html:ro
+      - certs:/certs
+    depends_on:
+      - app
+
+volumes:
+  db:
+  app:  
+  certs:

+ 0 - 0
web-ssl/Caddyfile → src/web-ssl/Caddyfile


+ 0 - 0
web-ssl/Dockerfile → src/web-ssl/Dockerfile


+ 0 - 0
web/Caddyfile → src/web/Caddyfile


+ 0 - 0
web/Dockerfile → src/web/Dockerfile