Skip to content

Commit f7d25b4

Browse files
committed
Use repo Dockerfile
1 parent a23b2ae commit f7d25b4

File tree

3 files changed

+65
-7
lines changed

3 files changed

+65
-7
lines changed

Dockerfile

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
FROM debian:buster-slim as base
2+
MAINTAINER JM Leroux <[email protected]>
3+
4+
ENV DEBIAN_FRONTEND noninteractive
5+
6+
RUN echo 'APT::Install-Recommends "0" ; APT::Install-Suggests "0" ;' > /etc/apt/apt.conf.d/01-no-recommended && \
7+
echo 'path-exclude=/usr/share/man/*' > /etc/dpkg/dpkg.cfg.d/path_exclusions && \
8+
echo 'path-exclude=/usr/share/doc/*' >> /etc/dpkg/dpkg.cfg.d/path_exclusions && \
9+
apt-get update && \
10+
apt-get --yes install \
11+
apt-transport-https \
12+
ca-certificates \
13+
curl \
14+
git \
15+
procps \
16+
unzip \
17+
wget
18+
19+
RUN wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg &&\
20+
sh -c 'echo "deb https://packages.sury.org/php/ buster main" > /etc/apt/sources.list.d/php.list' &&\
21+
apt-get update && \
22+
apt-get --yes install \
23+
php7.4-cli \
24+
php7.4-opcache \
25+
php7.4-xml \
26+
php7.4-curl \
27+
php7.4-mbstring \
28+
php7.4-bcmath \
29+
php7.4-apcu \
30+
php7.4-zip && \
31+
apt-get clean && rm -rf /var/lib/apt/lists/*
32+
33+
# Configure PHP CLI
34+
COPY docker/jmleroux.ini /etc/php/7.4/mods-available/jmleroux.ini
35+
RUN phpenmod jmleroux
36+
37+
FROM base as dev
38+
39+
RUN apt-get update && \
40+
apt-get --yes install \
41+
php7.4-xdebug && \
42+
apt-get clean && rm -rf /var/lib/apt/lists/*
43+
44+
# Install composer
45+
COPY --from=composer:2.0 /usr/bin/composer /usr/local/bin/composer
46+
RUN chmod +x /usr/local/bin/composer

docker-compose.yml

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
version: '3'
1+
version: '3.7'
22

33
services:
4-
fpm:
5-
image: jmleroux/fpm:php-7.2
4+
php:
5+
build:
6+
context: .
7+
target: dev
68
environment:
79
COMPOSER_HOME: /home/docker/.composer
810
PHP_IDE_CONFIG: 'serverName=circleci-api-client'
9-
PHP_XDEBUG_ENABLED: '${PHP_XDEBUG_ENABLED:-0}'
10-
PHP_XDEBUG_REMOTE_HOST: 172.17.0.1
11-
XDEBUG_CONFIG: 'remote_host=172.17.0.1'
12-
user: docker
11+
XDEBUG_MODE: '${XDEBUG_MODE:-off}'
12+
XDEBUG_CONFIG: 'client_host=172.17.0.1'
13+
XDEBUG_SESSION: 'circleci-api-client'
1314
volumes:
1415
- ./:/srv/project
1516
- ~/.composer:/home/docker/.composer

docker/jmleroux.ini

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
display_errors = On
2+
error_reporting = E_ALL
3+
4+
date.timezone = Etc/UTC
5+
6+
apc.enabled=1
7+
apc.enable_cli=1
8+
9+
xdebug.discover_client_host = 1
10+
11+
; priority=99

0 commit comments

Comments
 (0)