Merge branch 'f-breidenstein-better_dockerfile'

This commit is contained in:
El RIDO 2018-02-20 18:15:56 +01:00
commit 99972b5f7b
No known key found for this signature in database
GPG Key ID: 0F5C940A6BD81F92
3 changed files with 34 additions and 6 deletions

View File

@ -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-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ &&\
docker-php-ext-install -j$(nproc) gd; \ 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
docker-compose.yml Normal file
View File

@ -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
docker/entrypoint.sh Executable file
View File

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