Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,25 @@ RUN apt-get update && apt-get install -y \
nginx \
git \
curl \
sudo \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding debugging and build tools (sudo, vim, build-essential, etc.) significantly increases the image size and security risk. Consider moving these to a multi-stage build or a separate 'dev' target if this image is intended for production.

Suggested change
sudo \
+ # Consider moving dev tools to a separate build stage

vim \
nano \
less \
wget \
netcat-openbsd \
telnet \
iputils-ping \
procps \
htop \
tree \
jq \
openssh-client \
rsync \
build-essential \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libwebp-dev \
libonig-dev \
libxml2-dev \
libzip-dev \
Expand All @@ -18,7 +36,8 @@ RUN apt-get update && apt-get install -y \
supervisor \
&& rm -rf /var/lib/apt/lists/*

RUN docker-php-ext-install pdo_mysql pdo_pgsql mbstring exif pcntl bcmath gd zip
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install pdo_mysql pdo_pgsql mbstring exif pcntl bcmath gd zip

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

Expand All @@ -32,7 +51,11 @@ RUN set -eux; \
usermod -o -u ${HOST_UID} -g www-data www-data; \
else \
useradd -o -u ${HOST_UID} -g www-data -m -s /bin/bash www-data; \
fi
fi; \
chown -R www-data:www-data /var/www; \
mkdir -p /var/www/.composer/cache; \
chown -R www-data:www-data /var/www/.composer; \
sudo -u www-data git config --global --add safe.directory '*'

COPY nginx.conf /etc/nginx/sites-available/default
RUN rm -f /etc/nginx/sites-enabled/default \
Expand Down