ソースを参照

remove ssl.conf when using http config

throwaway 1 年間 前
コミット
eed32a153c

+ 1 - 0
.dockerignore

@@ -0,0 +1 @@
+.git

+ 2 - 2
Dockerfile

@@ -4,7 +4,6 @@ WORKDIR /var/www/html/4get
 RUN apk update && apk upgrade
 RUN apk add php apache2-ssl php83-fileinfo php83-openssl php83-iconv php83-common php83-dom php83-sodium php83-curl curl php83-pecl-apcu php83-apache2 imagemagick php83-pecl-imagick php-mbstring imagemagick-webp imagemagick-jpeg
 
-COPY ./docker/apache/ /etc/apache2/
 COPY . .
 
 RUN chmod 777 /var/www/html/4get/icons
@@ -14,4 +13,5 @@ EXPOSE 443
 
 ENV FOURGET_PROTO=http
 
-CMD  ["./docker/docker-entrypoint.sh"]
+ENTRYPOINT  ["./docker/docker-entrypoint.sh"]
+CMD ["start"]

+ 6 - 5
docker-compose.yaml

@@ -6,14 +6,15 @@ services:
     image: luuul/4get:latest
     restart: unless-stopped
     environment:
+      - FOURGET_PROTO=http
       - FOURGET_SERVER_NAME=4get.ca
+      - FOURGET_INSTANCES=https://4get.ca
 
     ports:
       - "80:80"
       - "443:443"
 
-    volumes:
-      - /etc/letsencrypt/live/domain.tld:/etc/4get/certs
-      # mount custom banners and captcha
-      - ./banners:/var/www/html/4get/banner
-      - ./captcha:/var/www/html/4get/data/captcha
+    # volumes:
+    # - /etc/letsencrypt/live/domain.tld:/etc/4get/certs # mount ssl
+    # - ./banners:/var/www/html/4get/banner # mount custom banners
+    # - ./captcha:/var/www/html/4get/data/captcha # mount captcha images

+ 1 - 0
docker/apache/http/conf.d/ssl.conf

@@ -0,0 +1 @@
+# intentionally blank

+ 0 - 0
docker/apache/http.conf → docker/apache/http/httpd.conf


+ 0 - 0
docker/apache/conf.d/ssl.conf → docker/apache/https/conf.d/ssl.conf


+ 0 - 0
docker/apache/https.conf → docker/apache/https/httpd.conf


+ 14 - 5
docker/docker-entrypoint.sh

@@ -8,18 +8,27 @@ FOURGET_PROTO="${FOURGET_PROTO#\"}"
 # make lowercase
 FOURGET_PROTO=`echo $FOURGET_PROTO | awk '{print tolower($0)}'`
 
+FOURGET_SRC='/var/www/html/4get'
+
+mkdir -p /etc/apache2
 
 if [ "$FOURGET_PROTO" = "https" ]; then
         echo "Using https configuration"
-        cp /etc/apache2/https.conf /etc/apache2/httpd.conf
+        cp -r ${FOURGET_SRC}/docker/apache/https/httpd.conf /etc/apache2
+        cp -r ${FOURGET_SRC}/docker/apache/https/conf.d/* /etc/apache2/conf.d
+
 else
         echo "Using http configuration"
-        cp /etc/apache2/http.conf /etc/apache2/httpd.conf
+        cp -r ${FOURGET_SRC}/docker/apache/http/httpd.conf /etc/apache2
+        cp -r ${FOURGET_SRC}/docker/apache/http/conf.d/* /etc/apache2/conf.d
 fi
 
 php ./docker/gen_config.php
 
-
-echo "4get is running"
-exec httpd -DFOREGROUND
+if [ "$@" = "start" ]; then
+        echo "4get is running"
+        exec httpd -DFOREGROUND
+else 
+        exec "$@"
+fi