aboutsummaryrefslogtreecommitdiff
path: root/.devcontainer
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-05-28 18:03:34 +0200
committerGravatar GitHub <noreply@github.com> 2023-05-28 18:03:34 +0200
commit0292b2f1f3a8cba3179467bba6c6af6bd0e97453 (patch)
tree65f2b10459c6046bc74556298a90d93187e80f1e /.devcontainer
parenteeefbdf9c720790b83cc82fd981929bf4d699120 (diff)
Improve Dev Container (#5423)
* Improve Dev Container PHPStan was failing in Dev Container * Update Docker to Alpine Linux 3.18 * New DATA_PATH environment variable * README
Diffstat (limited to '.devcontainer')
-rw-r--r--.devcontainer/Dockerfile3
-rw-r--r--.devcontainer/README.md22
-rw-r--r--.devcontainer/devcontainer.json9
-rwxr-xr-x.devcontainer/postCreateCommand.sh7
4 files changed, 34 insertions, 7 deletions
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index a2c1a2a2b..73073dcf1 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -1,4 +1,4 @@
-FROM alpine:3.17
+FROM alpine:3.18
ENV TZ UTC
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
@@ -26,6 +26,7 @@ RUN adduser --ingroup www-data --disabled-password developer && \
ENV COPY_LOG_TO_SYSLOG On
ENV COPY_SYSLOG_TO_STDERR On
ENV CRON_MIN ''
+ENV DATA_PATH ''
ENV FRESHRSS_ENV 'development'
ENV LISTEN '0.0.0.0:8080'
diff --git a/.devcontainer/README.md b/.devcontainer/README.md
new file mode 100644
index 000000000..22380bc8a
--- /dev/null
+++ b/.devcontainer/README.md
@@ -0,0 +1,22 @@
+# Dev Container for FreshRSS
+
+This is a [Development Container](https://containers.dev) to provide a one-click full development environment
+with all the needed tools and configurations, to develop and test [FreshRSS](https://github.com/FreshRSS/FreshRSS/).
+
+It can be used on your local machine (see for instance the [Dev Containers extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)),
+or as [GitHub Codespaces](https://github.com/features/codespaces) simply in a Web browser:
+
+[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=edge&repo=6322699)
+
+## Test instance of FreshRSS
+
+A test instance of FreshRSS is automatically started as visible from the *Ports* tab: check the *Local Address* column, and click on the *Open in browser* 🌐 icon.
+It runs the FreshRSS code that you are currently editing.
+
+## Software tests
+
+Running the tests can be done directly from the built-in terminal, e.g.:
+
+```sh
+make test-all
+```
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index a30fdf5c7..615d81741 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -4,7 +4,15 @@
"build": {
"dockerfile": "Dockerfile"
},
+ "containerEnv": {
+ "DATA_PATH": "/home/developer/freshrss-data"
+ },
"customizations": {
+ "codespaces": {
+ "openFiles": [
+ ".devcontainer/README.md"
+ ]
+ },
"vscode": {
"extensions": [
"bmewburn.vscode-intelephense-client",
@@ -13,6 +21,7 @@
"eamodio.gitlens",
"EditorConfig.EditorConfig",
"foxundermoon.shell-format",
+ "GitHub.vscode-pull-request-github",
"mrmlnc.vscode-apache",
"ms-azuretools.vscode-docker",
"redhat.vscode-yaml",
diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh
index f5398efb9..930ede974 100755
--- a/.devcontainer/postCreateCommand.sh
+++ b/.devcontainer/postCreateCommand.sh
@@ -4,14 +4,9 @@ ln -s "$(pwd)" /var/www/FreshRSS
cp ./Docker/*.Apache.conf /etc/apache2/conf.d/
-cat <<EOT >./constants.local.php
-<?php
-define('DATA_PATH', '/home/developer/freshrss-data');
-EOT
-
./Docker/entrypoint.sh
chown -R developer:www-data /home/developer/freshrss-data
-chmod -R g+w /home/developer/freshrss-data
+chmod -R g+rwX /home/developer/freshrss-data
httpd