diff options
| -rw-r--r-- | .devcontainer/Dockerfile | 31 | ||||
| -rw-r--r-- | .devcontainer/devcontainer.json | 37 | ||||
| -rwxr-xr-x | .devcontainer/postCreateCommand.sh | 17 |
3 files changed, 85 insertions, 0 deletions
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 000000000..db7db4d60 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,31 @@ +FROM alpine:3.16 + +ENV TZ UTC +SHELL ["/bin/ash", "-eo", "pipefail", "-c"] +RUN apk add --no-cache \ + apache2 php-apache2 \ + php php-curl php-gmp php-intl php-mbstring php-xml php-zip \ + php-ctype php-dom php-fileinfo php-iconv php-json php-opcache php-openssl php-phar php-session php-simplexml php-xmlreader php-xmlwriter php-xml php-tokenizer php-zlib \ + php-pdo_sqlite php-pdo_mysql php-pdo_pgsql \ + bash composer curl docker-cli-buildx git gpg make nodejs npm shellcheck shfmt sudo + +RUN rm -f /etc/apache2/conf.d/languages.conf /etc/apache2/conf.d/info.conf \ + /etc/apache2/conf.d/status.conf /etc/apache2/conf.d/userdir.conf && \ + sed -r -i "/^\s*LoadModule .*mod_(alias|autoindex|negotiation|status).so$/s/^/#/" \ + /etc/apache2/httpd.conf && \ + sed -r -i "/^\s*#\s*LoadModule .*mod_(deflate|expires|headers|mime|remoteip|setenvif).so$/s/^\s*#//" \ + /etc/apache2/httpd.conf && \ + sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" \ + /etc/apache2/httpd.conf + +RUN addgroup developer && \ + adduser --ingroup developer --disabled-password developer && \ + echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer + +ENV COPY_LOG_TO_SYSLOG On +ENV COPY_SYSLOG_TO_STDERR On +ENV CRON_MIN '' +ENV FRESHRSS_ENV 'development' +ENV LISTEN '0.0.0.0:8080' + +EXPOSE 8080 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..50318d75f --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,37 @@ +// For format details, see https://aka.ms/devcontainer.json +{ + "name": "FreshRSS-dev-Alpine", + "build": { + "dockerfile": "Dockerfile" + }, + "extensions": [ + "bmewburn.vscode-intelephense-client", + "DavidAnson.vscode-markdownlint", + "dbaeumer.vscode-eslint", + "eamodio.gitlens", + "EditorConfig.EditorConfig", + "foxundermoon.shell-format", + "mrmlnc.vscode-apache", + "redhat.vscode-yaml", + "timonwong.shellcheck", + "ValeryanM.vscode-phpsab" + ], + "forwardPorts": [ + 8080 + ], + "portsAttributes": { + "8080": { + "label": "FreshRSS Apache", + "onAutoForward": "notify" + } + }, + "mounts": [ + { + "source": "vscode-freshrss-data", + "target": "/home/developer/freshrss-data", + "type": "volume" + } + ], + "remoteUser": "developer", + "postCreateCommand": "sudo .devcontainer/postCreateCommand.sh" +} diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh new file mode 100755 index 000000000..f5398efb9 --- /dev/null +++ b/.devcontainer/postCreateCommand.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +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 + +httpd |
