tt-rss/.devcontainer/devcontainer.json
Tony b69713c841
chore: add devcontainer config (#221)
* chore: add devcontainer config

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: delay db init

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-29 21:09:45 -06:00

51 lines
2.0 KiB
JSON

// 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
"image": "mcr.microsoft.com/devcontainers/php:8-trixie",
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/git-lfs:1": {
"autoPull": true,
"version": "latest"
},
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"installYarnUsingApt": true,
"version": "lts",
"pnpmVersion": "latest",
"nvmVersion": "latest"
},
"ghcr.io/itsmechlark/features/postgresql:1": {
"version": "latest"
},
"ghcr.io/yassinedoghri/devcontainers/php-extensions-installer:1": {
"extensions": "gd intl pcntl pdo_pgsql",
"configuration": ""
}
},
// Configure tool-specific properties.
// "customizations": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
8080, 9000
],
"onCreateCommand": "cat > config.php << 'EOF'\n<?php\n\n\tputenv('TTRSS_DB_HOST=localhost');\n\tputenv('TTRSS_DB_NAME=postgres');\n\tputenv('TTRSS_DB_USER=postgres');\n\tputenv('TTRSS_DB_PASS=');\nEOF",
// 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",
"postStartCommand": {
"server": "php -S localhost:8080",
"db": "sleep 1 && php update.php --update-schema --force-yes"
}
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}