commit 717b623b719572f474e624b3aa33b2295f74785a Author: Robert Nasarek Date: Wed Oct 5 11:36:51 2022 +0200 first working instance without adminer diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..79b4a83 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.env +.git +graphdb.zip \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..551d4b6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.env +graphdb.zip \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c38b008 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,83 @@ +version: "3.8" + +services: + postgres: + image: postgres:alpine + container_name: dlza_postgresql + restart: unless-stopped + env_file: .env + volumes: + - db-data:/var/lib/postgresql/data + networks: + - internal + + drupal: + image: rnsrk/drupal:9.4.7-fpm-alpine-extended + build: + context: ./drupal_context + container_name: dlza_drupal + depends_on: + - postgres + restart: unless-stopped + networks: + - internal + - external + volumes: + - drupal-data:/opt/drupal + + webserver: + image: nginx:1.23-alpine + container_name: dlza_webserver + depends_on: + - drupal + restart: unless-stopped + ports: + - 3001:80 + volumes: + - drupal-data:/opt/drupal + - ./nginx-conf:/etc/nginx/conf.d + networks: + - external + solr: + image: solr:9 + container_name: dlza_solr + restart: always + volumes: + - solr-data:/opt/solr + environment: + SOLR_JAVA_MEM: "-Xms256M -Xmx512M" + ports: + - 3002:8983 + networks: + - external + graphdb: + image: rnsrk/graphdb:10.0.2 + container_name: dlza_graphdb + build: + context: ./graphdb_context + volumes: + - graphdb-data:/opt/graphdb + ports: + - 3003:7200 + networks: + - external + + adminer: + image: adminer:fastcgi + container_name: dlza_adminer + restart: always + networks: + - internal + - external + +networks: + external: + driver: bridge + internal: + driver: bridge + +volumes: + db-data: + drupal-data: + graphdb-data: + solr-data: \ No newline at end of file diff --git a/drupal_context/Dockerfile b/drupal_context/Dockerfile new file mode 100755 index 0000000..78948e8 --- /dev/null +++ b/drupal_context/Dockerfile @@ -0,0 +1,29 @@ +FROM drupal:9.4.7-fpm-alpine + +MAINTAINER Robert Nasarek "r.nasarek@gnm.de" + +# Install build environment +RUN apk add build-base autoconf vim + +# Install extensions +RUN pecl install apcu uploadprogress + +# Enable extensions +RUN docker-php-ext-enable apcu uploadprogress + +# Remove build packages +RUN apk del build-base autoconf + +# Custom PHP settings + +## PHP +RUN { \ + echo 'max_execution_time = 60'; \ + echo 'max_input_time = 30'; \ + echo 'max_input_nesting_level = 640'; \ + echo 'max_input_vars = 10000'; \ + echo 'memory_limit = 512M'; \ + echo 'upload_max_filesize = 20M'; \ + echo 'max_file_uploads = 50'; \ + echo 'post_max_size = 20M'; \ + } > /usr/local/etc/php/conf.d/99-custom-settings.ini; \ No newline at end of file diff --git a/graphdb_context/Dockerfile b/graphdb_context/Dockerfile new file mode 100755 index 0000000..a1070e8 --- /dev/null +++ b/graphdb_context/Dockerfile @@ -0,0 +1,27 @@ +FROM openjdk:11-slim-buster + +MAINTAINER Robert Nasarek "r.nasarek@gnm.de" + +# Silence debconf messages +RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections + +# Install. +RUN \ + sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \ + apt-get -qq update && \ + apt-get -y install unzip && \ + rm -rf /var/lib/apt/lists/* + +# Install GraphDB-Free and clean up +COPY ./graphdb.zip /tmp/graphdb.zip + +RUN \ + unzip /tmp/graphdb.zip -d /tmp && \ + mv /tmp/graphdb-* /graphdb && \ + rm /tmp/graphdb.zip + +# Set GraphDB Max and Min Heap size +ENV GDB_HEAP_SIZE="4G" + +EXPOSE 7200 +CMD ["/graphdb/bin/graphdb"] \ No newline at end of file diff --git a/nginx-conf/nginx.conf b/nginx-conf/nginx.conf new file mode 100644 index 0000000..1f78485 --- /dev/null +++ b/nginx-conf/nginx.conf @@ -0,0 +1,46 @@ +server { + listen 80; + listen [::]:80; + + server_name dlza.gnm.de www.dlza.gnm.de; + + index index.php index.html index.htm; + + root /opt/drupal/web/; + + location ~ /.well-known/acme-challenge { + allow all; + root /opt/drupal/web/; + } + + location / { + try_files $uri $uri/ /index.php$is_args$args; + } + + rewrite ^/core/authorize.php/core/authorize.php(.*)$ /core/authorize.php$1; + + location ~ \.php$ { + try_files $uri =404; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass drupal:9000; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + } + + location ~ /\.ht { + deny all; + } + + location = /favicon.ico { + log_not_found off; access_log off; + } + location = /robots.txt { + log_not_found off; access_log off; allow all; + } + location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ { + expires max; + log_not_found off; + } +}