diff --git a/.devcontainer.json b/.devcontainer.json deleted file mode 100644 index a2a6046..0000000 --- a/.devcontainer.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "image": "php:8.3-fpm", - "customizations": {}, - "mounts": [ - "source=/,target=/workspace,type=bind,consistency=delegated" - ], - "remoteEnv": { - "COMPOSER_ALLOW_SUPERUSER": "1" - }, - "postCreateCommand": "apt-get update && apt-get install -y build-essential postgresql-client libpng-dev libjpeg62-turbo-dev libfreetype6-dev libzip-dev locales zip jpegoptim optipng pngquant gifsicle git unzip && mkdir /workspace && cd /workspace && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && apt-get install -y libpq-dev && docker-php-ext-install pdo_pgsql && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash && export NVM_DIR=\"$HOME/.nvm\" && [ -s \"$NVM_DIR/nvm.sh\" ] && \\. \"$NVM_DIR/nvm.sh\" && [ -s \"$NVM_DIR/bash_completion\" ] && \\. \"$NVM_DIR/bash_completion\"", - "dockerComposeFile": "docker-compose.yml", - "service": "app", - "runServices": [ - "postgres", - "redis", - "mailhog" - ], - "forwardPorts": [ - "8000:8000", - "8025:8025" - ] -} diff --git a/.devcontainer/service/devcontainer.json b/.devcontainer/service/devcontainer.json new file mode 100644 index 0000000..c50e8e4 --- /dev/null +++ b/.devcontainer/service/devcontainer.json @@ -0,0 +1,44 @@ +{ + "name": "larapod", + "image": "php:8.1-fpm", + "extensions": [ + "felixfbecker.php-debug", + "editorconfig.editorconfig", + "esbenp.prettier-vscode", + "dbaeumer.vscode-eslint" + ], + "settings": { + "php.validate.enable": true, + "php.suggest.basic": false, + "php.executablePath": "/usr/local/bin/php" + }, + "mounts": [ + "source=.,target=/workspace,type=bind,consistency=delegated" + ], + "postCreateCommand": "apt-get update && apt-get install -y build-essential default-mysql-client libpng-dev libjpeg62-turbo-dev libfreetype6-dev libzip-dev locales zip jpegoptim optipng pngquant gifsicle git unzip && cd /workspace && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && apt-get install -y libpq-dev && docker-php-ext-install pdo_pgsql && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash && export NVM_DIR=\"$HOME/.nvm\" && [ -s \"$NVM_DIR/nvm.sh\" ] && \\. \"$NVM_DIR/nvm.sh\" && [ -s \"$NVM_DIR/bash_completion\" ] && \\. \"$NVM_DIR/bash_completion\" && nvm install lts/hydrogen && npm install -g pnpm && npm install -g @nestjs/cli", + "remoteEnv": { + "COMPOSER_ALLOW_SUPERUSER": "1" + }, + "services": { + "db": { + "image": "mysql:latest", + "ports": ["3306:3306"], + "environment": { + "MYSQL_DATABASE": "laravel", + "MYSQL_USER": "laravel", + "MYSQL_PASSWORD": "password", + "MYSQL_ROOT_PASSWORD": "password" + }, + "command": "mysqld --general-log=1 --general-log-file=/var/lib/mysql/general.log", + "volumes": ["mysql_data:/var/lib/mysql"] + }, + "redis": { + "image": "redis:latest", + "ports": ["6379:6379"], + "volumes": ["redis_data:/data"] + } + }, + "forwardPorts": [3306, "db:3306", 8000, "redis:6379"], + "remoteExtensions": ["ms-vscode-remote.vscode-remote-extensionpack"], + "volumes": ["mysql_data:/var/lib/mysql", "redis_data:/data"] +} diff --git a/docker-compose.yml b/.devcontainer/service/docker-compose.yml similarity index 100% rename from docker-compose.yml rename to .devcontainer/service/docker-compose.yml