Skip to content

Commit 1752aa1

Browse files
committed
initial docker and composer prep
1 parent ab55c48 commit 1752aa1

File tree

7 files changed

+101
-4
lines changed

7 files changed

+101
-4
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NEO4J_CONNECTIONS=bolt://neo4j:test@neo4j,http://neo4j:test@neo4j,bolt://neo4j:test@core1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
.php_cs.cache
88
.phpunit.result.cache
99
.idea
10+
.env

Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
FROM php:8.0-cli
2+
RUN apt-get update && apt-get install -y \
3+
libfreetype6-dev \
4+
libjpeg62-turbo-dev \
5+
libmcrypt-dev \
6+
libpng-dev \
7+
libzip-dev \
8+
zip \
9+
unzip \
10+
git \
11+
wget \
12+
&& docker-php-ext-install -j$(nproc) gd sockets bcmath \
13+
&& pecl install ds pcov \
14+
&& docker-php-ext-enable ds \
15+
&& wget https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 \
16+
&& mv test-reporter-latest-linux-amd64 /usr/bin/cc-test-reporter \
17+
&& chmod +x /usr/bin/cc-test-reporter
18+
19+
RUN pecl install xdebug \
20+
&& docker-php-ext-enable xdebug
21+
22+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
23+
24+
WORKDIR /opt/project
25+
26+
COPY composer.json composer.loc[k] phpunit.xml.dist psalm.xml Neo4jBundle.php ./
27+
COPY Collector/ Collector/
28+
COPY DependencyInjection/ DependencyInjection/
29+
COPY EventSubscriber/ EventSubscriber/
30+
COPY Factory/ Factory/
31+
COPY Resources/ Resources/
32+
COPY Tests/ Tests/
33+
34+
35+
RUN composer install
36+
37+

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616
],
1717
"require": {
1818
"php": ">=7.2",
19-
"anyitsolutions/neo4j-bolt": "^1.6",
20-
"anyitsolutions/neo4j-php-client": "^4.6.4",
19+
"laudis/neo4j-php-client": "2.1.2",
2120
"symfony/dependency-injection": "^4.4 || ^5.0",
2221
"symfony/framework-bundle": "^4.4 || ^5.0",
2322
"symfony/http-kernel": "^4.4 || ^5.0",
2423
"twig/twig": "^2.0 || ^3.0"
2524
},
2625
"require-dev": {
27-
"symfony/phpunit-bridge": "^4.4 || ^5.0",
28-
"matthiasnoback/symfony-dependency-injection-test": "^4.1"
26+
"matthiasnoback/symfony-dependency-injection-test": "^4.1",
27+
"phpunit/phpunit": "^9.5",
28+
"symfony/phpunit-bridge": "^4.4 || ^5.0"
2929
},
3030
"suggest": {
3131
"plumtreesystems/neo4j-php-ogm": "To have EntityManager support"

docker-compose.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
version: '3.2'
2+
3+
networks:
4+
neo4j:
5+
driver: bridge
6+
7+
services:
8+
client:
9+
build:
10+
context: .
11+
dockerfile: Dockerfile
12+
working_dir: /opt/project
13+
networks:
14+
- neo4j
15+
volumes:
16+
- .:/opt/project
17+
- ./docker/php/conf.d/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
18+
- ./docker/php/conf.d/error_reporting.ini:/usr/local/etc/php/conf.d/error_reporting.ini
19+
depends_on:
20+
- neo4j
21+
- core1
22+
- core2
23+
- core3
24+
- readreplica1
25+
expose:
26+
- 9000
27+
env_file:
28+
- .env
29+
neo4j:
30+
networks:
31+
- neo4j
32+
image: neo4j:4.3-enterprise
33+
healthcheck:
34+
test: [ "CMD", "neo4j status" ]
35+
interval: 30s
36+
timeout: 10s
37+
retries: 5
38+
expose:
39+
- 7474
40+
- 7687
41+
ports:
42+
- "7474:7474"
43+
- "7687:7687"
44+
environment:
45+
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
46+
- NEO4J_AUTH=neo4j/test
47+
- NEO4J_dbms_security_allow__csv__import__from__file__urls=true
48+
volumes:
49+
- ./tests/resources:/import

docker/php/conf.d/error_reporting.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
error_reporting=E_ALL

docker/php/conf.d/xdebug.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
zend_extension=xdebug
2+
3+
[xdebug]
4+
xdebug.mode=develop,debug
5+
xdebug.client_host=host.docker.internal
6+
xdebug.start_with_request=yes
7+
xdebug.discover_client_host=true
8+
xdebug.log=/tmp/xdebug.log

0 commit comments

Comments
 (0)