-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (36 loc) · 1.14 KB
/
Dockerfile
File metadata and controls
47 lines (36 loc) · 1.14 KB
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
41
42
43
44
45
46
47
# Stage 1: Install dependencies
FROM composer:2@sha256:743aebe48ca67097c36819040633ea77e44a561eca135e4fc84c002e63a1ba07 AS composer_build
WORKDIR /app
# Copy only composer files first to leverage Docker cache
COPY composer.json ./
# Install production dependencies
# We ignore platform reqs here because we know they are met in the final image
RUN composer install \
--no-dev \
--optimize-autoloader \
--no-interaction \
--no-progress \
--no-scripts \
--ignore-platform-reqs
# Stage 2: Final image
FROM dunglas/frankenphp:latest@sha256:f3454939ef7b292dbe3848d7c597bbf0234a446a40494a8ddbd0ccd9a442ca11
# Disable HTTPS by default for the container
ENV SERVER_NAME=:80
# Enable production PHP settings
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
# Install additional PHP extensions
RUN install-php-extensions \
bcmath \
curl \
intl \
zip \
opcache \
sodium
# Set the working directory
WORKDIR /app
# Copy vendor from builder
COPY --from=composer_build /app/vendor /app/vendor
# Copy application code
COPY . /app
# Set default environment variables
ENV OPENAPI_SPEC=/app/data/openapi.yaml