File tree Expand file tree Collapse file tree 5 files changed +94
-8
lines changed Expand file tree Collapse file tree 5 files changed +94
-8
lines changed Original file line number Diff line number Diff line change 99 name : PHP CS Fixer
1010 runs-on : ubuntu-latest
1111
12+ services :
13+ neo4j :
14+ image : neo4j:latest
15+ ports :
16+ - 7474:7474
17+ - 7687:7687
18+ env :
19+ NEO4J_AUTH : neo4j/password
20+ options : --health-cmd="curl --silent --fail localhost:7474" --health-interval=10s --health-retries=5 --health-timeout=5s
21+
1222 steps :
1323 - name : Checkout code
1424 uses : actions/checkout@v3
1525
16- - name : Set up PHP
17- uses : shivammathur/setup-php@v2
18- with :
19- php-version : 8.2
20- tools : composer
26+ - name : Set up Docker Compose
27+ run : docker-compose -f docker-compose.yml up -d
2128
22- - name : Install dependencies
23- run : composer install --no-progress --prefer-dist
29+ - name : Install Composer dependencies
30+ run : docker exec -t php-app composer install --no-progress --prefer-dist
2431
2532 - name : Run PHP CS Fixer
26- run : vendor/bin/php-cs-fixer fix --dry-run --diff --allow-risky=yes
33+ run : |
34+ docker exec -t php-app vendor/bin/php-cs-fixer fix --dry-run --diff --allow-risky=yes
35+
36+ - name : Clean up Docker
37+ run : docker-compose down
Original file line number Diff line number Diff line change 99 name : Run Psalm
1010 runs-on : ubuntu-latest
1111
12+ services :
13+ neo4j :
14+ image : neo4j:latest
15+ ports :
16+ - 7474:7474
17+ - 7687:7687
1218 steps :
1319 - name : Checkout code
1420 uses : actions/checkout@v3
Original file line number Diff line number Diff line change 1313 name : Run PHPUnit Tests
1414 runs-on : ubuntu-latest
1515
16+ services :
17+ neo4j :
18+ image : neo4j:latest
19+ ports :
20+ - 7474:7474
21+ - 7687:7687
1622 steps :
1723 - name : Checkout code
1824 uses : actions/checkout@v3
Original file line number Diff line number Diff line change 1+ # Use an official PHP image as the base image
2+ FROM php:8.2-fpm
3+
4+ # Install necessary extensions (e.g., for Composer)
5+ RUN apt-get update && apt-get install -y libpng-dev libjpeg-dev libfreetype6-dev \
6+ && docker-php-ext-configure gd --with-freetype --with-jpeg \
7+ && docker-php-ext-install gd
8+
9+ # Set working directory
10+ WORKDIR /var/www
11+
12+ # Copy the composer.phar file to the container
13+ COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
14+
15+ # Expose PHP-FPM port
16+ EXPOSE 9000
17+
18+ # Start PHP-FPM server
19+ CMD ["php-fpm" ]
Original file line number Diff line number Diff line change 1+ version : ' 3.8'
2+
3+ services :
4+ # PHP Service
5+ app :
6+ build :
7+ context : .
8+ dockerfile : Dockerfile
9+ container_name : php-app
10+ working_dir : /var/www
11+ volumes :
12+ - .:/var/www
13+ networks :
14+ - mynetwork
15+ ports :
16+ - " 9000:9000" # Exposing port for PHP-FPM
17+
18+ # Composer Service
19+ composer :
20+ image : composer:latest
21+ container_name : composer
22+ volumes :
23+ - .:/var/www
24+ working_dir : /var/www
25+ networks :
26+ - mynetwork
27+ command : ["install", "--no-progress", "--prefer-dist"]
28+
29+ # Neo4j Service (Optional, if you need Neo4j)
30+ neo4j :
31+ image : neo4j:latest
32+ container_name : neo4j
33+ environment :
34+ - NEO4J_AUTH=neo4j/password
35+ ports :
36+ - " 7474:7474" # Web interface
37+ - " 7687:7687" # Bolt protocol
38+ networks :
39+ - mynetwork
40+
41+ # Define a network for communication between containers
42+ networks :
43+ mynetwork :
44+ driver : bridge
You can’t perform that action at this time.
0 commit comments