-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
122 lines (99 loc) · 3 KB
/
Dockerfile
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#
#--------------------------------------------------------------------------
# Image Setup
#--------------------------------------------------------------------------
#
FROM phusion/baseimage:0.11
LABEL maintainer="Cosmo Weng <cosmos-s@hotmail.com.tw>"
ARG PHP_VERSION=7.4
RUN DEBIAN_FRONTEND=noninteractive
RUN locale-gen en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV LC_CTYPE=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV TERM xterm
# Add the "PHP 7" ppa
RUN apt-get install -y software-properties-common && \
add-apt-repository -y ppa:ondrej/php
#
#--------------------------------------------------------------------------
# Software's Installation
#--------------------------------------------------------------------------
#
RUN echo 'DPkg::options { "--force-confdef"; };' >> /etc/apt/apt.conf
# Install "PHP Extentions", "libraries", "Software's"
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --allow-downgrades --allow-remove-essential \
--allow-change-held-packages \
php7.4-cli \
php7.4-common \
php7.4-curl \
php7.4-intl \
php7.4-json \
php7.4-xml \
php7.4-mbstring \
php7.4-mysql \
php7.4-pgsql \
php7.4-sqlite \
php7.4-sqlite3 \
php7.4-zip \
php7.4-bcmath \
php7.4-memcached \
php7.4-gd \
php7.4-dev \
pkg-config \
libcurl4-openssl-dev \
libedit-dev \
libssl-dev \
libxml2-dev \
xz-utils \
libsqlite3-dev \
rsync \
sqlite3 \
git \
curl \
vim \
nano \
tree \
postgresql-client \
&& apt-get clean
#####################################
# Composer:
#####################################
# Install composer and add its bin to the PATH.
RUN curl -s http://getcomposer.org/installer | php && \
echo "export PATH=${PATH}:/var/www/vendor/bin" >> ~/.bashrc && \
mv composer.phar /usr/local/bin/composer
#####################################
# OpenCC:
#####################################
ARG OPENCC_VERSION="ver.1.1.1"
RUN apt-get install -y cmake doxygen g++ make git python \
&& cd /tmp && git clone https://github.com/BYVoid/OpenCC.git && cd OpenCC \
&& git checkout -b ${OPENCC_VERSION} \
&& make \
&& make install \
&& apt-get purge -y make doxygen cmake
#####################################
# opencc4php:
#####################################
RUN apt-get install -y php7.4-dev \
&& cd /tmp && git clone https://github.com/NauxLiu/opencc4php.git && cd opencc4php \
&& phpize \
&& ./configure \
&& make && make install
# && apt-get purge -y php7.0-dev
COPY ./php_mods/opencc.ini /etc/php/${PHP_VERSION}/mods-available/opencc.ini
RUN phpenmod opencc
#####################################
# Dockerize:
#####################################
RUN apt-get update && apt-get install -y wget
ENV DOCKERIZE_VERSION v0.6.1
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
# Source the bash
RUN . ~/.bashrc