From f042e1820ce379b01dcb2853448f2aab0cd5efaf Mon Sep 17 00:00:00 2001 From: Saninn Salas Diaz <5490201+distante@users.noreply.github.com> Date: Mon, 22 Jan 2024 19:38:56 +0000 Subject: [PATCH] chore: created dev container with nextcloud instance --- .devcontainer/Dockerfile | 20 +++++++++++++++++++ .devcontainer/devcontainer.json | 34 ++++++++++++++++++++++++++++++++ .devcontainer/docker-compose.yml | 29 +++++++++++++++++++++++++++ .gitignore | 5 +++++ 4 files changed, 88 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/docker-compose.yml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..729fc3ea --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,20 @@ +# Use the official Nextcloud image as the base image +FROM nextcloud + +RUN echo "alias ll='ls -alF'" >> /etc/bash.bashrc +# Install Node.js 18 and npm +RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \ + apt-get install -y nodejs && \ + rm -rf /var/lib/apt/lists/* + +# Install Needed libs +# Install Git, wget, and PHP Composer +RUN apt-get update && \ + apt-get install -y git wget make unzip + +# Install PHP Composer +RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ + php composer-setup.php --install-dir=/usr/local/bin --filename=composer && \ + php -r "unlink('composer-setup.php');" + +RUN composer global require "vimeo/psalm" \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..be1e055e --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,34 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/alpine +{ + "name": "Nextcloud DevContainer", + "dockerComposeFile": ["./docker-compose.yml"], + "service": "nextcloud", + "workspaceFolder": "/var/www/html/custom_apps/memories", + // Features to add to the dev container. More info: https://containers.dev/features. + "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + "postCreateCommand": "echo 'Container Created'", + // Configure tool-specific properties. + "customizations": { + "vscode": { + "extensions": [ + "bmewburn.vscode-intelephense-client", + "muuvmuuv.vscode-just-php-cs-fixer", + "getpsalm.psalm-vscode-plugin", + "esbenp.prettier-vscode", + "Vue.volar", + "Vue.vscode-typescript-vue-plugin" + ], + "settings": { + "terminal.integrated.shell.linux": "/bin/bash" + // Add any other VS Code settings you need for your project + } + } + }, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + "remoteUser": "root" +} diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 00000000..e827a919 --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,29 @@ +name: 'nextcloud-with-memories' +services: + nextcloud: + build: + context: . + dockerfile: Dockerfile + volumes: + # - nextcloud:/var/www/html + # - apps:/var/www/html/custom_apps + - ./custom_apps:/var/www/html/custom_apps + - ./../:/var/www/html/custom_apps/memories + - ./config:/var/www/html/config + # - config:/var/www/html/config + - ./data:/var/www/html/data + # - theme:/var/www/html/themes/ + ports: + - 9080:80 + image: nextcloud +# volumes: +# nextcloud: +# name: nextcloud +# apps: +# name: apps +# config: +# name: config +# data: +# name: data +# theme: +# name: theme diff --git a/.gitignore b/.gitignore index 07b43c32..f8b11a15 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,8 @@ memories.tar.gz .cache/ bin-ext/ + +# Dev Container +.devcontainer/config/* +.devcontainer/custom_apps/* +.devcontainer/data/*