Update devcontainer

This commit is contained in:
Tommy Stigen Olsen 2024-02-07 17:59:50 +01:00
parent 6d31498ad3
commit 8daed9327c
3 changed files with 55 additions and 28 deletions

View File

@ -2,37 +2,15 @@
"image": "php:8.3-fpm", "image": "php:8.3-fpm",
"customizations": {}, "customizations": {},
"mounts": [ "mounts": [
"source=/,target=/workspace,type=bind,consistency=delegated"
], ],
"remoteEnv": { "remoteEnv": {
"COMPOSER_ALLOW_SUPERUSER": "1" "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\"", "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\"",
"services": { "dockerComposeFile": ".devcontainer/docker-compose.yml",
"db": { "service": "app",
"image": "postgres:14",
"ports": ["5432:5432"],
"environment": {
"MYSQL_DATABASE": "laravel",
"MYSQL_USER": "laravel",
"MYSQL_PASSWORD": "password",
"MYSQL_ROOT_PASSWORD": "password"
},
"volumes": ["postgres_data:/var/lib/postgresql/data"]
},
"redis": {
"image": "redis:latest",
"ports": ["6379:6379"],
"volumes": ["redis_data:/data"]
},
"forwardPorts": [ "forwardPorts": [
8000, "8000:8000"
5432,
"db:5432",
"redis:6379"
],
"volumes": [
"postgres_data:/var/lib/postgresql/data",
"redis_data:/data"
] ]
} }
}

View File

@ -0,0 +1,49 @@
version: '3'
networks:
laravel:
services:
app:
image: php:8.1-fpm
environment:
DB_CONNECTION: pgsql
DB_HOST: postgres
DB_PORT: 5432
DB_DATABASE: video_sub
DB_USERNAME: postgres
DB_PASSWORD: postgres
MAIL_HOST: mailhog
depends_on:
- postgres
- redis
- mailhog
links:
- postgres
- redis
- mailhog
postgres:
image: postgres:14-alpine
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=video_sub
networks:
- laravel
redis:
image: redis:latest
ports:
- 6379:6379
mailhog:
image: mailhog/mailhog:latest
ports:
- "1025:1025"
- "8025:8025"
networks:
- laravel
volumes:
postgres_data:

View File

@ -29,7 +29,7 @@ REDIS_PASSWORD=null
REDIS_PORT=6379 REDIS_PORT=6379
MAIL_MAILER=smtp MAIL_MAILER=smtp
MAIL_HOST=mailpit MAIL_HOST=mailhog
MAIL_PORT=1025 MAIL_PORT=1025
MAIL_USERNAME=null MAIL_USERNAME=null
MAIL_PASSWORD=null MAIL_PASSWORD=null