mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
Minor improvements for devcontainer
* Autostart apache2 * Apply occ installation on start * Autostart Xdebug on request * Add DevContainer Xdebug profile Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
parent
81df7d636e
commit
16c14c059d
6 changed files with 59 additions and 13 deletions
|
|
@ -5,7 +5,7 @@ ARG DEBIAN_FRONTEND=noninteractive
|
|||
# PHP
|
||||
RUN apt-get update -y
|
||||
|
||||
RUN apt install -y apache2 vim software-properties-common
|
||||
RUN apt install -y apache2 vim software-properties-common sudo nano
|
||||
|
||||
RUN add-apt-repository ppa:ondrej/php
|
||||
|
||||
|
|
@ -42,6 +42,12 @@ RUN apt-get install --no-install-recommends -y \
|
|||
RUN echo "xdebug.remote_enable = 1" >> /etc/php/8.1/cli/conf.d/20-xdebug.ini
|
||||
RUN echo "xdebug.remote_autostart = 1" >> /etc/php/8.1/cli/conf.d/20-xdebug.ini
|
||||
|
||||
# Autostart XDebug for apache
|
||||
RUN { \
|
||||
echo "xdebug.mode=debug"; \
|
||||
echo "xdebug.start_with_request=yes"; \
|
||||
} >> /etc/php/8.1/apache2/conf.d/20-xdebug.ini
|
||||
|
||||
# Docker
|
||||
RUN apt-get -y install \
|
||||
apt-transport-https \
|
||||
|
|
|
|||
|
|
@ -16,4 +16,5 @@ $CONFIG = [
|
|||
if(is_string($codespaceName) && !empty($codespaceName) && is_string($codespaceDomain) && !empty($codespaceDomain)) {
|
||||
$CONFIG['overwritehost'] = $codespaceName . '-80.' . $codespaceDomain;
|
||||
$CONFIG['overwriteprotocol'] = 'https';
|
||||
$CONFIG['trusted_domains'] = [ $CONFIG['overwritehost'] ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,15 +8,18 @@
|
|||
8080,
|
||||
8025
|
||||
],
|
||||
"runArgs": [
|
||||
"--privileged"
|
||||
],
|
||||
"extensions": [
|
||||
"felixfbecker.php-debug",
|
||||
"felixfbecker.php-intellisense",
|
||||
"ms-azuretools.vscode-docker"
|
||||
],
|
||||
"settings": {
|
||||
"php.suggest.basic": false,
|
||||
}
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"felixfbecker.php-debug",
|
||||
"felixfbecker.php-intellisense",
|
||||
"ms-azuretools.vscode-docker",
|
||||
"xdebug.php-debug"
|
||||
],
|
||||
"settings": {
|
||||
"php.suggest.basic": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"workspaceFolder": "/var/www/html"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ services:
|
|||
- .:/workspace:cached
|
||||
- /var/run/docker.sock:/var/run/docker-host.sock
|
||||
- ..:/var/www/html
|
||||
command: /bin/sh -c "while sleep 1000; do :; done"
|
||||
command: /bin/sh -c "chown -R www-data:www-data /var/www/html && service apache2 start && while sleep 1000; do :; done"
|
||||
ports:
|
||||
- 80:80
|
||||
- 8080:8080
|
||||
|
|
|
|||
|
|
@ -6,3 +6,25 @@ git submodule update --init
|
|||
|
||||
# Codespace config
|
||||
cp .devcontainer/codespace.config.php config/codespace.config.php
|
||||
|
||||
# Set git safe.directory
|
||||
git config --global --add safe.directory /var/www/html
|
||||
|
||||
# Onetime installation setup
|
||||
if [ ! -f "data/.devcontainer-install-complete" ]; then
|
||||
echo "Running NC installation"
|
||||
sudo -u www-data php occ maintenance:install \
|
||||
--verbose \
|
||||
--database=pgsql \
|
||||
--database-name=postgres \
|
||||
--database-host=127.0.0.1 \
|
||||
--database-port=5432 \
|
||||
--database-user=postgres \
|
||||
--database-pass=postgres \
|
||||
--admin-user admin \
|
||||
--admin-pass admin && \
|
||||
touch "data/.devcontainer-install-complete"
|
||||
fi
|
||||
|
||||
# Clear caches and stuff ...
|
||||
service apache2 restart
|
||||
|
|
|
|||
14
.vscode/launch.json
vendored
Normal file
14
.vscode/launch.json
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Listen for Xdebug",
|
||||
"type": "php",
|
||||
"request": "launch",
|
||||
"port": 9003
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in a new issue