-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
69 lines (53 loc) · 1.86 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
FROM php:7.1.0-fpm-alpine
# https://github.com/smebberson/docker-alpine/tree/master/alpine-base
# https://github.com/prooph/docker-files/blob/master/php/7.1-fpm
ENV S6_OVERLAY_VERSION=v1.18.1.5 \
GODNSMASQ_VERSION=1.0.7 \
NGINX_VERSION=1.10.1-r1 \
XDEBUG_VERSION=2.5.0
ENV PHPIZE_DEPS \
autoconf \
cmake \
file \
g++ \
gcc \
libc-dev \
make \
pkgconf \
re2c
WORKDIR /
RUN apk add --no-cache --virtual .persistent-deps bind-tools git bash nginx=${NGINX_VERSION} mysql-client
RUN apk add --no-cache --virtual .build-deps curl $PHPIZE_DEPS
# Install Whatever is needed
RUN set -xe \
# S6
&& curl -sSL https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-amd64.tar.gz | tar xfz - -C / \
# Go DNS MASQ
&& curl -sSL https://github.com/janeczku/go-dnsmasq/releases/download/${GODNSMASQ_VERSION}/go-dnsmasq-min_linux-amd64 -o /bin/go-dnsmasq \
# Composer
&& curl -sS https://getcomposer.org/installer | php -- --filename=/usr/local/bin/composer \
# XDebug
# && pecl install xdebug-${XDEBUG_VERSION} \
# create user and give binary permissions to bind to lower port
&& chmod +x /bin/go-dnsmasq \
&& addgroup go-dnsmasq \
&& adduser -D -g "" -s /bin/sh -G go-dnsmasq go-dnsmasq \
&& setcap CAP_NET_BIND_SERVICE=+eip /bin/go-dnsmasq \
# Install nginx
&& chown -R nginx:www-data /var/lib/nginx \
# Remove basic config
&& rm -r /usr/local/etc/* \
&& rm -rf /var/cache/apk/* \
&& apk del .build-deps \
# Create App Dir
&& rm -rf /var/www/* \
&& mkdir /var/www/app
# Add docker files
ADD docker /
# Install/Enable PHP Extensions: TODO: MISSING!!!!!!!!
RUN docker-php-ext-install pdo pdo_mysql bcmath
# && docker-php-ext-enable xdebug
# Expose the ports for nginx
EXPOSE 80
WORKDIR /var/www/app
ENTRYPOINT ["/init"]