Skip to content

Commit 5e615c4

Browse files
Added dockerfile
1 parent 3b61d1a commit 5e615c4

File tree

3 files changed

+59
-14
lines changed

3 files changed

+59
-14
lines changed

.gitlab-ci.yml

+2-14
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
1-
image: binhle410/php7.2-fpm
1+
image: awescodehub/php7.2-fpm-gitlab
22

33
cache:
44
paths:
55
- vendor/
66

77
before_script:
8-
# Install git, the php image doesn't have installed
9-
- apt-get update -yqq
10-
- apt-get install git -yqq
11-
12-
# Install Xdebug
13-
- pecl install xdebug
14-
- docker-php-ext-enable xdebug
15-
16-
# Install composer
17-
- curl -sS https://getcomposer.org/installer | php
18-
198
# Install all project dependencies
20-
- php composer.phar install
21-
9+
- composer install
2210

2311
# Run our tests
2412
test:

Dockerfile

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM php:7.2-fpm
2+
3+
RUN apt-get update && apt-get install -y \
4+
locales git unzip curl openssl ssh libz-dev \
5+
libfreetype6-dev libmcrypt-dev libxml2-dev
6+
7+
RUN pecl install igbinary xdebug \
8+
&& docker-php-ext-install -j$(nproc) mbstring zip bcmath soap \
9+
&& docker-php-ext-enable igbinary xdebug
10+
11+
RUN dpkg-reconfigure locales \
12+
&& locale-gen C.UTF-8 \
13+
&& /usr/sbin/update-locale LANG=C.UTF-8
14+
15+
# intl
16+
RUN apt-get update \
17+
&& apt-get install -y libicu-dev \
18+
&& docker-php-ext-configure intl \
19+
&& docker-php-ext-install intl
20+
21+
RUN echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && locale-gen
22+
23+
ENV LC_ALL C.UTF-8
24+
ENV LANG en_US.UTF-8
25+
ENV LANGUAGE en_US.UTF-8
26+
27+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
28+
29+
COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
30+
31+
RUN sed -i "s/xdebug.remote_autostart=0/xdebug.remote_autostart=1/" /usr/local/etc/php/conf.d/xdebug.ini && \
32+
sed -i "s/xdebug.remote_enable=0/xdebug.remote_enable=1/" /usr/local/etc/php/conf.d/xdebug.ini && \
33+
sed -i "s/xdebug.cli_color=0/xdebug.cli_color=1/" /usr/local/etc/php/conf.d/xdebug.ini
34+
35+
# Clean up
36+
RUN apt-get clean && \
37+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
38+
rm /var/log/lastlog /var/log/faillog

xdebug.ini

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
; NOTE: The actual debug.so extention is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini)
2+
3+
xdebug.remote_connect_back=0
4+
xdebug.remote_port=9009
5+
xdebug.remote_host=172.19.1.15
6+
xdebug.idekey=PHPSTORM
7+
8+
xdebug.remote_autostart=0
9+
xdebug.remote_enable=0
10+
xdebug.cli_color=0
11+
xdebug.profiler_enable=0
12+
xdebug.profiler_output_dir="~/xdebug/phpstorm/tmp/profiling"
13+
14+
xdebug.remote_handler=dbgp
15+
xdebug.remote_mode=req
16+
17+
xdebug.var_display_max_children=-1
18+
xdebug.var_display_max_data=-1
19+
xdebug.var_display_max_depth=-1

0 commit comments

Comments
 (0)