-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
75 lines (64 loc) · 2.61 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
FROM alpine:3.8
LABEL maintainer="Ihor Furseyev <i.furseyev@atwix.com>"
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.name="furseyev/magento1"
LABEL org.label-schema.description="Opinionated docker image for Magento 1.9.4+."
LABEL org.label-schema.vcs-url="https://github.com/furseyev/docker-magento1"
# Install packages
RUN apk add --update --no-cache \
php7 php7-bcmath php7-ctype php7-curl php7-dom php7-fileinfo php7-fpm php7-gd php7-iconv php7-intl php7-mbstring php7-mysqli php7-opcache php7-pdo_mysql php7-redis php7-session php7-simplexml php7-soap php7-tokenizer php7-xsl php7-xml php7-xmlwriter php7-zip \
composer php7-xdebug \
nginx nginx-mod-http-headers-more \
bash runit \
curl htop git libxml2-utils make openssh vim \
mysql-client redis \
nodejs sassc yarn \
msmtp \
procps patch
# Configure msmtp
RUN unlink /usr/sbin/sendmail \
&& ln -s /usr/bin/msmtp /usr/sbin/sendmail
# Add non-privileged web server user
# Configure nginx and php
ENV PHP_LOG_STREAM="/var/log/php.log"
RUN deluser xfs \
&& delgroup www-data \
&& addgroup -S -g 33 www-data \
&& adduser -S -D -u 33 -G www-data -h /var/www -s /bin/bash www-data \
&& chown -R www-data:www-data /var/tmp/nginx \
&& rm -f /etc/nginx/conf.d/default.conf \
&& ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log \
&& mkfifo -m 777 $PHP_LOG_STREAM
# Install prestissimo for parallel composer downloads
USER www-data
RUN composer global require hirak/prestissimo \
&& rm -rf /var/www/.composer/cache
USER root
RUN composer global require hirak/prestissimo \
&& rm -rf /root/.composer/cache
# n98-magerun for Magento 1
ENV MAGERUN_VERSION 1.102.0
RUN curl -sL https://files.magerun.net/n98-magerun-$MAGERUN_VERSION.phar -o /usr/local/bin/n98-magerun \
&& chmod +x /usr/local/bin/n98-magerun \
&& n98-magerun --version
# Install dockerize
ENV DOCKERIZE_VERSION v0.6.1
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& dockerize -version
# Install config files and tester site
COPY ./config/nginx /etc/nginx
COPY ./config/php7 /etc/php7
COPY ./config/services /services
# Test nginx configuration
RUN /usr/sbin/nginx -T
# Set working directory
RUN mkdir -p /var/www/magento1 \
&& chown -R www-data:www-data /var/www
WORKDIR /var/www/magento1
# Default command; run nginx and php-fpm services
CMD ["/sbin/runsvdir", "/services"]
# Expose ports
EXPOSE 8080