-
Notifications
You must be signed in to change notification settings - Fork 90
/
Dockerfile
73 lines (62 loc) · 2.18 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
FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive
ARG PHP_VERSION=8.1
ENV LC_ALL=C.UTF-8
# Install basic tools
RUN apt-get update && apt-get install -y \
software-properties-common \
curl \
make \
supervisor \
unzip \
python2 \
g++
# Append NODE, NGINX and PHP repositories
RUN add-apt-repository ppa:ondrej/php \
&& add-apt-repository ppa:ondrej/nginx \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash -
# Install required PHP extensions
RUN apt-get update && apt-get install -y \
nodejs \
nginx \
php${PHP_VERSION} \
php${PHP_VERSION}-apcu \
php${PHP_VERSION}-calendar \
php${PHP_VERSION}-common \
php${PHP_VERSION}-cli \
php${PHP_VERSION}-ctype \
php${PHP_VERSION}-curl \
php${PHP_VERSION}-dom \
php${PHP_VERSION}-exif \
php${PHP_VERSION}-fpm \
php${PHP_VERSION}-gd \
php${PHP_VERSION}-intl \
php${PHP_VERSION}-mbstring \
php${PHP_VERSION}-mysql \
php${PHP_VERSION}-opcache \
php${PHP_VERSION}-pdo \
php${PHP_VERSION}-pgsql \
php${PHP_VERSION}-sqlite \
php${PHP_VERSION}-xml \
php${PHP_VERSION}-xsl \
php${PHP_VERSION}-yaml \
php${PHP_VERSION}-zip
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename composer
# Cleanup
RUN apt-get remove --purge -y software-properties-common curl && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* /usr/share/man/*
# Create directory for php-fpm socket
# Link php-fpm binary file without version
# -p Creates missing intermediate path name directories
RUN ln -s /usr/sbin/php-fpm${PHP_VERSION} /usr/sbin/php-fpm && mkdir -p /run/php
# Install yarn
RUN npm install -g yarn && npm cache clean --force
# Initialize config files
COPY .docker/supervisord.conf /etc/supervisor/conf.d/supervisor.conf
COPY .docker/nginx.conf /etc/nginx/nginx.conf
COPY .docker/fpm.conf /etc/php/${PHP_VERSION}/fpm/pool.d/www.conf
COPY .docker/php.ini /etc/php/${PHP_VERSION}/fpm/php.ini
COPY .docker/php.ini /etc/php/${PHP_VERSION}/cli/php.ini
WORKDIR /app
EXPOSE 80
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]