Explorar el Código

Merge branch 'f-breidenstein-better_dockerfile'

El RIDO hace 8 años
padre
commit
99972b5f7b
Se han modificado 3 ficheros con 34 adiciones y 6 borrados
  1. 15 6
      Dockerfile
  2. 15 0
      docker-compose.yml
  3. 4 0
      docker/entrypoint.sh

+ 15 - 6
Dockerfile

@@ -3,15 +3,24 @@ FROM php:apache
 RUN apt-get update && apt-get install -y \
 RUN apt-get update && apt-get install -y \
         libfreetype6-dev \
         libfreetype6-dev \
         libjpeg62-turbo-dev \
         libjpeg62-turbo-dev \
-        libpng12-dev \
+        libpng-dev \
         wget \
         wget \
         zip \
         zip \
-        unzip; \
+        unzip && \
     # We install and enable php-gd
     # We install and enable php-gd
-    docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/; \
-    docker-php-ext-install -j$(nproc) gd; \
-
+    docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ &&\
+    docker-php-ext-install -j$(nproc) gd && \
     # We enable Apache's mod_rewrite
     # We enable Apache's mod_rewrite
     a2enmod rewrite
     a2enmod rewrite
 
 
-COPY . .
+
+# Copy app content
+COPY . /var/www/html
+
+# Copy start script
+RUN mv /var/www/html/docker/entrypoint.sh / && \
+    rm -r /var/www/html/docker
+
+VOLUME /var/www/html/data
+
+CMD /entrypoint.sh

+ 15 - 0
docker-compose.yml

@@ -0,0 +1,15 @@
+version: '3'
+
+services:
+  privatebin:
+    build: .
+    ports:
+      - "3000:80"
+    volumes:
+      - data:/var/www/html/data
+      # Optionally mount a custom config file
+      #- /srv/docker/privatebin/conf.php:/var/www/html/cfg/conf.php
+    
+volumes:
+  data:
+

+ 4 - 0
docker/entrypoint.sh

@@ -0,0 +1,4 @@
+#! /bin/sh
+
+chown -R www-data /var/www/html/data
+apache2-foreground