Browse Source

Merge pull request #35 from yuki-xin/master

Docker支持
pull/36/head
xiaoz 6 years ago committed by GitHub
parent
commit
953c981e3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      .dockerignore
  2. 26
      Dockerfile
  3. 10
      docker-compose.yml

3
.dockerignore

@ -0,0 +1,3 @@
Dockerfile
docker-compose.yml
.dockerignore

26
Dockerfile

@ -0,0 +1,26 @@
FROM php:7.1-apache-jessie
MAINTAINER ZQian<zqiannnn@gmail.com>
# Environment
#RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
#RUN sed -i 's|security.debian.org/debian-security|mirrors.ustc.edu.cn/debian-security|g' /etc/apt/sources.list
RUN apt-get update && apt-get install -y wget libjpeg-dev libpng-dev libfreetype6-dev libmagickwand-dev --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
# ImageMagick
&& pecl install http://pecl.php.net/get/imagick-3.4.3.tgz \
# Rewrite
&& sed -i '166s/None/All/g' /etc/apache2/apache2.conf \
&& ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
# Ext
RUN 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-enable imagick
# Application
ENV IMAGE_VERSION=2.0
COPY . /var/www/html
RUN chmod a+w imgs data
VOLUME ["/var/www/html/data","/var/www/html/imgs"]
CMD ["apache2-foreground"]

10
docker-compose.yml

@ -0,0 +1,10 @@
version: '3'
services:
imgurl:
build: . # 编译需要梯子,没有梯子可删去本行用已经编译好的镜像
image: zqiannnn/imgurl:2.0
ports:
- 8080:80
volumes:
- ./data:/var/www/html/data
- ./imgs:/var/www/html/imgs
Loading…
Cancel
Save