-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.Ubuntu
104 lines (89 loc) · 3.07 KB
/
Dockerfile.Ubuntu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
ARG FROM_IMAGE=php:8-fpm-alpine
FROM $FROM_IMAGE
LABEL build_version="version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="Carlos Gomes <carlos.algms@gmail.com>"
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
zsh \
vim \
make \
ca-certificates \
nginx \
supervisor \
&& apt-get autoremove -y --purge \
&& apt-get autoclean \
&& apt-get clean \
&& rm -rf /var/cache/debconf/*-old \
&& rm -rf /usr/share/doc/* \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/apt/* \
&& ln -sfn /dev/stdout /var/log/nginx/access.log \
&& ln -sfn /dev/stderr /var/log/nginx/error.log
ARG PECL_EXT="mcrypt-1.0.4 imagick-3.7.0"
ARG PHP_EXT="gd mysqli pdo_mysql opcache pspell bcmath exif zip pcntl"
ARG ENABLE_EXT="mcrypt imagick"
# These libs are different from php >= 7 and 5.x
ARG VARIABLE_LIBS="libmagickwand-6.q16-6"
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
## shared libraries that must stay
aspell \
gettext-base \
libzip4 \
libmcrypt4 \
libfreetype6 \
libjpeg62-turbo \
${VARIABLE_LIBS} \
imagemagick-6-common \
libpng16-16 \
libaspell15 \
libzip4 \
zlib1g \
## the next ones must be uninstalled after build
libfreetype6-dev \
libjpeg62-turbo-dev \
libmagickwand-dev \
libmcrypt-dev \
libpng-dev \
libpspell-dev \
libzip-dev \
&& pecl install -n $PECL_EXT \
&& docker-php-ext-enable $ENABLE_EXT \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j "$(nproc)" $PHP_EXT \
# remove packages used only to build PHP extensions
&& apt-get remove -y --purge \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmagickwand-dev \
libmcrypt-dev \
libpng-dev \
libpspell-dev \
libzip-dev \
&& apt-get autoremove -y --purge \
&& apt-get autoclean \
&& apt-get clean \
&& rm -rf /var/cache/debconf/*-old \
&& rm -rf /usr/share/doc/* \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/apt/*
ARG DEPLOYER_VERSION="v6.8.0"
ARG COMPOSER_VERSION="????"
RUN curl "https://getcomposer.org/installer" --output "composer-setup.php" \
&& php -r "if (hash_file('sha384', 'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; } echo PHP_EOL;" \
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer \
&& rm "composer-setup.php"
# Add Tini
ADD https://github.com/krallin/tini/releases/download/v0.19.0/tini /usr/bin/tini
RUN chmod +x /usr/bin/tini
ENTRYPOINT ["tini", "--"]
COPY ["default-site.conf", "/etc/nginx/sites-available/default"]
COPY ["snippets/*", "/etc/nginx/snippets/"]
COPY ["php.ini", "/usr/local/etc/php/conf.d/"]
COPY ["php-nginx-supervisor.conf", "/etc/supervisor/conf.d/"]
COPY ["php-fpm-log.conf", "/usr/local/etc/php-fpm.d/"]
COPY ["zshrc", "/root/.zshrc"]
CMD export ROOT_PATH=${ROOT_PATH:-/var/www/html} && \
envsubst < /etc/nginx/snippets/root.conf.template > /etc/nginx/snippets/root.conf && \
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf -n