-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (27 loc) · 998 Bytes
/
Dockerfile
File metadata and controls
35 lines (27 loc) · 998 Bytes
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
FROM php:8.1-cli
# Match CI locale settings
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
# Install system dependencies for PHP extensions and locale
RUN apt-get update && apt-get install -y --no-install-recommends \
libzip-dev \
libsqlite3-dev \
libonig-dev \
locales \
unzip \
git \
&& sed -i 's/# en_US.UTF-8/en_US.UTF-8/' /etc/locale.gen \
&& locale-gen \
&& docker-php-ext-install zip pdo pdo_sqlite mbstring \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Install Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
WORKDIR /app
# Install dependencies first (cached layer for faster rebuilds)
COPY composer.json composer.lock* ./
RUN composer install --no-interaction --no-progress --optimize-autoloader 2>/dev/null || true
# Copy the rest of the source
COPY . .
# Re-run install in case the cached layer was stale
RUN composer install --no-interaction --no-progress --optimize-autoloader
CMD ["bash"]