Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: support devcontainer development #220

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM mcr.microsoft.com/devcontainers/php:8.1-bookworm

RUN pecl install grpc protobuf && docker-php-ext-enable grpc protobuf
33 changes: 33 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/php
{
"name": "PHP",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"dockerFile": "Dockerfile",

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
},

// Configure tool-specific properties.

"customizations" : {
"jetbrains" : {
"backend" : "IntelliJ",
"plugins": ["com.jetbrains.php"],
}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [8080],

"containerEnv": {
"MOMENTO_API_KEY": "${localEnv:MOMENTO_API_KEY}"
},

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html"

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.PHONY: install lint-check lint test

install:
@echo "Installing dependencies..."
@composer install

lint-check:
@echo "Checking code style..."
@php vendor/bin/php-cs-fixer fix --diff --dry-run --show-progress=none

lint:
@echo "Fixing code style..."
@php vendor/bin/php-cs-fixer fix --diff --show-progress=none

test:
@echo "Running tests..."
@php vendor/phpunit/phpunit/phpunit --configuration phpunit.xml
Loading