-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathDockerfile.test
More file actions
33 lines (25 loc) · 1.31 KB
/
Copy pathDockerfile.test
File metadata and controls
33 lines (25 loc) · 1.31 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
# Test-only image — never pushed, never used in production. Reuses the same
# php:7.4-apache base as the main Dockerfile (already pulled locally in most
# cases) so layers are shared, but adds Composer/PHPUnit, which the shipped
# image intentionally does not carry.
FROM php:7.4-apache
# snmp (not just libsnmp-dev) must stay installed: purging libsnmp-dev alone
# cascades to remove libsnmp40 too (nothing else would depend on it), which
# breaks the compiled snmp.so at runtime. Keep both packages listed.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
sqlite3 libsqlite3-dev snmp libsnmp-dev git unzip curl \
&& docker-php-ext-install pdo_sqlite snmp \
&& apt-get purge -y --auto-remove libsqlite3-dev libsnmp-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN { \
echo 'error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE'; \
} > /usr/local/etc/php/conf.d/custom.ini
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
WORKDIR /app
COPY composer.json /app/composer.json
RUN composer install --no-interaction --prefer-dist
COPY . /app
RUN mkdir -p protected/runtime && cp protected/data/phpnetmap.db protected/runtime/test.db
CMD ["vendor/bin/phpunit", "-c", "protected/tests/phpunit.xml"]