@@ -4,9 +4,6 @@ ARG NGINX_VERSION="1.17.4"
4
4
ARG COMPOSER_VERSION="2.0"
5
5
ARG XDEBUG_VERSION="3.0.3"
6
6
ARG COMPOSER_AUTH
7
- ARG IMAGE_DEPS="fcgi tini icu-dev gettext curl"
8
- ARG RUNTIME_DEPS="zip"
9
-
10
7
# -------------------------------------------------- Composer Image ----------------------------------------------------
11
8
12
9
FROM composer:${COMPOSER_VERSION} as composer
@@ -19,8 +16,7 @@ FROM composer:${COMPOSER_VERSION} as composer
19
16
FROM php:${PHP_VERSION}-fpm-alpine AS base
20
17
21
18
# Required Args ( inherited from start of file, or passed at build )
22
- ARG IMAGE_DEPS
23
- ARG RUNTIME_DEPS
19
+ ARG XDEBUG_VERSION
24
20
25
21
# Maintainer label
26
22
LABEL maintainer="sherifabdlnaby@gmail.com"
@@ -182,17 +178,22 @@ CMD ["php-fpm"]
182
178
183
179
FROM base as app-dev
184
180
185
- ARG XDEBUG_VERSION
181
+
186
182
ENV APP_ENV dev
187
183
ENV APP_DEBUG 1
188
184
189
185
# Switch root to install stuff
190
186
USER root
191
187
192
188
# For Composer Installs
193
- RUN apk add git openssh
194
- # Enable Xdebug
195
- RUN docker-php-ext-enable xdebug
189
+ RUN apk add git openssh;
190
+ # Enable Xdebug
191
+ docker-php-ext-enable xdebug; \
192
+
193
+ # For Xdebuger to work, it needs the docker host ID
194
+ # - in Mac AND Windows, `host.docker.internal` resolve to Docker host IP
195
+ # - in Linux, `172.17.0.1` is the host IP
196
+ ENV XDEBUG_CLIENT_HOST="host.docker.internal"
196
197
197
198
# ---------------------------------------- ---------- Scripts ---------------------------------------------------------
198
199
@@ -229,6 +230,7 @@ RUN chown -R www-data /etc/nginx/ && chmod +x /usr/local/bin/nginx-*
229
230
# # Localhost is the sensible default assuming image run on a k8S Pod
230
231
ENV PHP_FPM_HOST "localhost"
231
232
ENV PHP_FPM_PORT "9000"
233
+ ENV NGINX_LOG_FORMAT "json"
232
234
233
235
# For Documentation
234
236
EXPOSE 8080
@@ -253,4 +255,5 @@ COPY --chown=www-data:www-data --from=app /app/public /app/public
253
255
254
256
# ----------------------------------------------------- NGINX ----------------------------------------------------------
255
257
FROM nginx AS web-dev
256
- # # Place holder to have a consistent naming.
258
+
259
+ ENV NGINX_LOG_FORMAT "combined"
0 commit comments