-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (28 loc) · 818 Bytes
/
Dockerfile
File metadata and controls
40 lines (28 loc) · 818 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
36
37
38
39
40
ARG PHP_VERSION=8.4
FROM php:${PHP_VERSION}-cli AS base
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
unzip \
libssl-dev \
libcurl4-openssl-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
# Copy Composer from official image
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Set working directory
WORKDIR /app
# Set environment variable for Composer
ENV COMPOSER_ALLOW_SUPERUSER=1
CMD ["tail", "-f", "/dev/null"]
FROM base AS dev
# Install XDebug extension
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug
FROM base AS ci
# Copy composer files
COPY composer.json composer.lock* ./
# Install dependencies including dev dependencies for testing
RUN composer install --optimize-autoloader
# Copy application code
COPY . .