-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
64 lines (53 loc) · 1.73 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
FROM php:7-fpm
WORKDIR /var/www
EXPOSE 443
RUN apt-get update && apt-get install -y --no-install-recommends \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libldb-dev \
unzip \
curl \
mysql-client \
zip \
libjpeg-dev \
libgif-dev \
apt-utils \
zlib1g-dev \
&& docker-php-ext-install -j$(nproc) pdo_mysql mysqli \
&& docker-php-ext-install zip \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd
# install protobuf
RUN cd /tmp && curl -OL https:/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip \
&& unzip protoc-3.2.0-linux-x86_64.zip -d protoc3 \
&& mv protoc3/bin/* /usr/local/bin/ \
&& mv protoc3/include/* /usr/local/include/
RUN pecl install grpc
RUN pecl install protobuf
# enable php extension
RUN docker-php-ext-enable grpc && \
docker-php-ext-enable protobuf
# install nginx
RUN apt update -y && apt install -y nginx
COPY ./nginx.vhost.conf /etc/nginx/conf.d/default.conf
COPY ./nginx.conf /etc/nginx/nginx.conf
RUN mkdir -p /run/nginx
# copy crt
RUN mkdir /crt
COPY ./nginx.crt /crt/nginx.crt
COPY ./nginx.key /crt/nginx.key
# PHP protoc plugin
# ONLY FOR DEV
#RUN mkdir -p /tmp/php-protoc && \
# git clone -b $(curl -L https://grpc.io/release) https:/grpc/grpc /tmp/php-protoc && \
# cd /tmp/php-protoc && \
# git submodule update --init && \
# make grpc_php_plugin && \
# mkdir /opt && \
# mv /tmp/php-protoc/bins/opt/* /opt && \
# rm -Rf /tmp/php-protoc
COPY . /var/www
COPY ./start.sh /start.sh
RUN chmod +x /start.sh
CMD /start.sh