-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
65 lines (52 loc) · 1.37 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
FROM zeit/wait-for:0.2 as wait
# Build dependencies
FROM composer:latest as vendor
COPY src/composer.json composer.json
COPY src/composer.lock composer.lock
RUN composer install --ignore-platform-reqs \
--no-interaction --no-plugins --no-scripts \
--prefer-dist --no-dev
FROM alpine:3.8
LABEL maintainer="Eivind Mikael Lindbråten <eivindml@icloud.com>"
LABEL description="Minimal Craft CMS Container using nginx."
# Copy over Craft files
COPY src/ /www/
# Copy over vendor files
COPY --from=vendor /app/vendor /www/vendor
# install nginx, php, and php extensions for Craft
RUN apk add --no-cache \
bash \
nginx \
php7 \
php7-fpm \
php7-opcache \
php7-phar \
php7-zlib \
php7-ctype \
php7-session \
php7-fileinfo \
# Required php extensions for Craft
php7-pdo \
php7-pdo_mysql \
php7-gd \
php7-openssl \
php7-mbstring \
php7-json \
php7-curl \
php7-zip \
# Optional extensions for Craft
php7-iconv \
php7-intl \
php7-dom \
# Extra Optional extensions for Craft
imagemagick \
php7-imagick
COPY docker/php.ini /etc/php7/
COPY docker/nginx.conf /etc/nginx/
COPY docker/www.conf /etc/php7/php-fpm.d/
RUN chmod 777 -R /www/*
# Expose default port
EXPOSE 80
SHELL ["/bin/bash", "-c"]
COPY --from=wait /bin/wait-for /bin/wait-for
CMD php-fpm7 -F & (wait-for /tmp/php7-fpm.sock && nginx) & wait -n