File tree 2 files changed +56
-46
lines changed
2 files changed +56
-46
lines changed Original file line number Diff line number Diff line change 1
1
FROM ubuntu:20.04
2
2
3
+ ARG PHP=7.4
3
4
ARG DEBIAN_FRONTEND=noninteractive
4
5
5
- RUN apt-get update -yqq && apt-get install -yqq \
6
- software-properties-common build-essential
6
+ # Install development tooling
7
+ RUN apt-get update -yqq && \
8
+ apt-get install -yqq \
9
+ software-properties-common build-essential git unzip
7
10
8
- RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null
9
- RUN apt-get update -yqq && apt-get install -yqq \
10
- php7.4-dev php7.4-curl composer php-pear pkg-config libevent-dev
11
+ # Install PHP and extensions including PostgreSQL support
12
+ RUN apt-get install -yqq \
13
+ php-pear pkg-config libevent-dev \
14
+ php${PHP}-dev php${PHP}-mbstring php${PHP}-curl php${PHP}-pgsql
11
15
16
+ # Install libevent to speed up the framework
12
17
RUN printf "\n\n /usr/lib/x86_64-linux-gnu/\n\n\n no\n\n\n " | \
13
18
pecl install event && \
14
- echo "extension=event.so" > /etc/php/7.4/cli/conf.d/event.ini
19
+ echo "extension=event.so" > /etc/php/${PHP}/cli/conf.d/event.ini
20
+
21
+ # Install Composer 2.0
22
+ RUN curl -sS https://getcomposer.org/installer -o composer-setup.php && \
23
+ php composer-setup.php --install-dir=/usr/local/bin --filename=composer
15
24
16
25
COPY ./ /var/www/
17
26
WORKDIR /var/www
18
- RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet
27
+
28
+ RUN composer install --optimize-autoloader --classmap-authoritative --no-dev
19
29
20
30
CMD php app.php start
You can’t perform that action at this time.
0 commit comments