Skip to content

Commit 646d699

Browse files
committed
Fix Dockerfile
1 parent d4e7946 commit 646d699

File tree

2 files changed

+56
-46
lines changed

2 files changed

+56
-46
lines changed

Dockerfile

+17-7
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
11
FROM ubuntu:20.04
22

3+
ARG PHP=7.4
34
ARG DEBIAN_FRONTEND=noninteractive
45

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
710

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
1115

16+
# Install libevent to speed up the framework
1217
RUN printf "\n\n /usr/lib/x86_64-linux-gnu/\n\n\nno\n\n\n" | \
1318
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
1524

1625
COPY ./ /var/www/
1726
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
1929

2030
CMD php app.php start

composer.lock

+39-39
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)