This commit is contained in:
Chuck Lantz 2020-08-31 16:26:11 -07:00
Родитель 927b22006f
Коммит e57336b89d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 1A864C1F8173A215
5 изменённых файлов: 15 добавлений и 13 удалений

Просмотреть файл

@ -32,11 +32,12 @@ services:
# Overrides default command so things don't shut down after the process ends.
command: /bin/sh -c "while sleep 1000; do :; done"
# You can include other services not opened by VS Code as well
another-service:
image: debian:latest
restart: unless-stopped
# This causes the service to run on the same network as the app container, allows "forwardPorts" in devcontainer.json function.
network_mode: service:your-service-name-here
# You can include other services not opened by VS Code as well
another-service:
image: mongo:latest
restart: unless-stopped
# This causes the service to run on the same network as the app container, allows "forwardPorts" in devcontainer.json function.
network_mode: service:app
# As in the "app" service, use "forwardPorts" in **devcontainer.json** to forward an app port locally.

Просмотреть файл

@ -1,6 +1,8 @@
{
"name": "Bash (Community)",
"dockerfile": "Dockerfile",
"build": {
"dockerfile": "Dockerfile"
},
// Set *default* container specific settings.json values on container create.
"settings": {

Просмотреть файл

@ -32,7 +32,6 @@ services:
volumes:
- mariadb-data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: mariadb
MYSQL_DATABASE: mariadb
MYSQL_USER: mariadb
MYSQL_PASSWORD: mariadb

Просмотреть файл

@ -17,10 +17,10 @@ Develop PHP based applications with MariaDB (MySQL Compatible). Includes necess
This definition creates two containers, one for PHP and one for MariaDB. Code will attach to the PHP container, and from within that container the MariaDB container will be available on **`localhost`** port 3306. The MariaDB instance can be managed via the automatically installed SQLTools extension, or from the container's command line with:
```bash
mariadb -h localhost -u root -p
mariadb -h localhost -P 3306 --protocol=tcp -u root --password=mariadb -D mariadb
```
The default database is called `mariadb` with a `mariadb` user whose password is `mariadb`, and if desired this may be changed in `docker-compose.yml`. Data is stored in a volume named `mariadb-data`.
The default database is called `mariadb` with a `mariadb` user whose password is `mariadb`, and if desired this may be changed in `docker-compose.yml`. Data is stored in a volume named `mariadb-data`. Note that you will **not** be able to access the MariaDB socket, so be sure to specify `--protocol=tcp` when using the command line.
## Using this definition with an existing folder

Просмотреть файл

@ -45,7 +45,7 @@ check "git" git --version
check "command-line-tools" which top ip lsb_release
check "php" php --version
sleep 15 # Sleep to be sure MariaDB is running.
check "mariadb" mariadb -h mariadb -P 3306 -u root --password=just-for-testing -D mariadb -Bse exit
check "mariadb" mariadb -h localhost -P 3306 --protocol=tcp -u root --password=mariadb -D mariadb -Bse exit
# -- Report results --
if [ ${#FAILED[@]} -ne 0 ]; then