فهرست منبع

implements docker for the new typo3 instance

Olivier Massot 5 سال پیش
والد
کامیت
e3d73f1055
4فایلهای تغییر یافته به همراه36 افزوده شده و 42 حذف شده
  1. 2 0
      docker-compose.yaml
  2. 6 33
      docker/typo3/Dockerfile
  3. 0 9
      docker/typo3/conf/cli
  4. 28 0
      docker/typo3/entrypoint.sh

+ 2 - 0
docker-compose.yaml

@@ -162,9 +162,11 @@ services:
     restart: always
     volumes:
       - ./apps/ot_typo3:/var/opentalent/git/ot_typo3:cached
+      - ./apps/ot_typo3/docker/typo3:/var/www/typo3:delegated
     environment:
       - VIRTUAL_HOST=${TYPO3_VIRTUAL_HOST}
       - HTTPS_METHOD=noredirect
+      - PHP_IDE_CONFIG=servername=typo3
     depends_on:
       - api
   adminassos:

+ 6 - 33
docker/typo3/Dockerfile

@@ -10,13 +10,8 @@ COPY /docker/typo3/conf/xdebug.ini /usr/local/etc/php/conf.d/
 # Configure apache
 COPY /docker/typo3/conf/typo3.conf /etc/apache2/sites-available/
 
-# Prepare typo3 install
-COPY /apps/ot_typo3/docker/mount/composer.json /var/www/typo3/
-COPY /apps/ot_typo3/docker/mount/LocalConfiguration.php /var/www/typo3/public/typo3conf/
-COPY /apps/ot_typo3/docker/conf/sites.tar.gz /var/www/typo3/config/
-
 # Set workdir
-WORKDIR /var/www/typo3
+WORKDIR /var/www
 
 RUN \
     # Install utilities and php extensions
@@ -37,34 +32,12 @@ RUN \
     php composer-setup.php; \
     php -r "unlink('composer-setup.php');"; \
 
-    # Install Typo3
-    php composer.phar install; \
-
-    # Install the ot_typo3 extensions:
-    mkdir -p /var/www/typo3/public/typo3conf/ext; \
-    ln -s /var/opentalent/git/ot_typo3/ot_templating /var/www/typo3/public/typo3conf/ext/ot_templating \
-    && ln -s /var/opentalent/git/ot_typo3/ot_connect /var/www/typo3/public/typo3conf/ext/ot_connect \
-    && ln -s /var/opentalent/git/ot_typo3/ot_optimizer /var/www/typo3/public/typo3conf/ext/ot_optimizer \
-    && ln -s /var/opentalent/git/ot_typo3/ot_admin /var/www/typo3/public/typo3conf/ext/ot_admin; \
-    chown -R www-data:www-data /var/www/typo3; \
-
-    # Untar the sites.yaml
-    mkdir -p /var/www/typo3/config; \
-    tar -xzf /var/www/typo3/config/sites.tar.gz -C /var/www/typo3/config/; \
-
-    # Finalize installation
-    mkdir -p /var/www/typo3/var; \
-    php composer.phar dumpautoload; \
-    chown -R www-data:www-data /var/www/typo3/; \
-
     # Configure apache
     rm /etc/apache2/sites-available/000-default.conf && rm /etc/apache2/sites-available/default-ssl.conf; \
     a2ensite typo3; \
-    service apache2 restart; \
-
-    # enable the install tool
-    touch /var/www/typo3/public/typo3conf/ENABLE_INSTALL_TOOL
-
-# Copy the cli shortcut
-COPY /docker/typo3/conf/cli /var/www/typo3/
+    service apache2 restart;
 
+# Declare the entrypoint.sh file
+COPY ./docker/typo3/entrypoint.sh /entrypoint.sh
+RUN chmod +x /entrypoint.sh
+ENTRYPOINT ["/entrypoint.sh"]

+ 0 - 9
docker/typo3/conf/cli

@@ -1,9 +0,0 @@
-#!/bin/sh
-
-# Shortcut for the typo3 commandline
-#
-# usage:
-#
-#     sh cli [options] <command>
-
-php /var/www/typo3/vendor/bin/typo3 $*

+ 28 - 0
docker/typo3/entrypoint.sh

@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# Prepare
+cd /var/www/typo3
+mv /var/www/composer.phar /var/www/typo3/composer.phar
+ln -s /var/opentalent/git/ot_typo3/install/composer.json /var/www/typo3/composer.json
+
+# Install Typo3 and extensions
+php composer.phar install
+ln -s /var/opentalent/git/ot_typo3/ot_templating /var/www/typo3/public/typo3conf/ext/ot_templating
+ln -s /var/opentalent/git/ot_typo3/ot_connect /var/www/typo3/public/typo3conf/ext/ot_connect
+ln -s /var/opentalent/git/ot_typo3/ot_optimizer /var/www/typo3/public/typo3conf/ext/ot_optimizer
+ln -s /var/opentalent/git/ot_typo3/ot_admin /var/www/typo3/public/typo3conf/ext/ot_admin
+php composer.phar dumpautoload
+
+# Add custom configuration
+ln -s /var/opentalent/git/ot_typo3/docker/LocalConfiguration.php /var/www/typo3/public/typo3conf/LocalConfiguration.php
+mkdir -p /var/www/typo3/config
+ln -s /var/opentalent/git/ot_typo3/docker/sites.tar.gz /var/www/typo3/config/sites.tar.gz
+tar -xzf /var/www/typo3/config/sites.tar.gz -C /var/www/typo3/config/
+
+# Finalize
+ln -s /var/opentalent/git/ot_typo3/install/cli /var/www/typo3/cli
+chown -R www-data:www-data /var/www/typo3
+touch /var/www/typo3/public/typo3conf/ENABLE_INSTALL_TOOL
+
+# Continue with apache job (without it, docker exits here)
+apache2-foreground