Skip to content

Commit f32ca9c

Browse files
committed
docs: clarify devstack compose defaults
1 parent ad6fbdc commit f32ca9c

2 files changed

Lines changed: 45 additions & 21 deletions

File tree

README.md

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@ Great LAMP devstack based on **Docker** & **Docker Compose** for your home progr
1313

1414
- Apache 2.4.x
1515
- PHP 7.2.x + Composer + PHPMailer
16+
- MariaDB 10.1
17+
- Adminer 4.3.x
18+
19+
Optional services are prepared in `docker-compose.yml`, but are commented out until you enable them:
20+
1621
- PHP 5.6.x + Composer + PHPMailer
1722
- NodeJS 8.x + NPM 5.x
18-
- MariaDB 10.1
1923
- PostgreSQL 9.6
20-
- Adminer 4.3.x
2124

2225
## Install
2326

@@ -35,6 +38,9 @@ Great LAMP devstack based on **Docker** & **Docker Compose** for your home progr
3538
- `DEVSTACK_DOCKER=~/.devstack/docker-compose.yml` (docker compose file)
3639
- `DEVSTACK_PREFIX=devstack` (container's prefix)
3740
- `DEVSTACK_USER=dfx` (attached user in container) [you can leave it]
41+
- `DEVSTACK_COMPOSE` (optional compose command override; defaults to `docker compose` with `docker-compose` fallback)
42+
43+
The compose file mounts your SSH agent into containers, so `SSH_AUTH_SOCK` should point to a running SSH agent socket. If you do not use agent forwarding, the `devstack` script uses `/tmp/devstack-ssh-agent` as a fallback; override it with `DEVSTACK_SSH_AUTH_SOCK` if needed.
3844
3945
3. Make `devstack` managing script executable.
4046
@@ -52,19 +58,19 @@ Great LAMP devstack based on **Docker** & **Docker Compose** for your home progr
5258
5359
### Ports
5460
55-
| Container | Ports | IP |
56-
|---------------|----------|--------------|
57-
| Apache | 80 / 443 | 172.10.10.5 |
58-
| PHP 7.2 + FPM | | 172.10.10.10 |
59-
| PHP 5.6 + FPM | | 172.10.10.11 |
60-
| NodeJS | | 172.10.10.12 |
61-
| Adminer | 8000 | 172.10.10.13 |
62-
| MariaDB | 3306 | 172.10.10.20 |
63-
| PostgreSQL | 5432 | 172.10.10.21 |
61+
| Container | Ports | IP |
62+
|--------------------------|----------|--------------|
63+
| Apache | 80 / 443 | 172.10.10.5 |
64+
| PHP 7.2 + FPM | | 172.10.10.10 |
65+
| PHP 5.6 + FPM (optional) | | 172.10.10.11 |
66+
| NodeJS (optional) | | 172.10.10.12 |
67+
| Adminer | 8000 | 172.10.10.13 |
68+
| MariaDB | 3306 | 172.10.10.20 |
69+
| PostgreSQL (optional) | 5432 | 172.10.10.21 |
6470
6571
### Docker Compose (`docker-compose.yml`)
6672
67-
I have prepared docker configuration file for you. You can [download it here](https://github.com/dockette/devstack/blob/master/docker-compose.yml).
73+
I have prepared docker configuration file for you. You can [download it here](https://github.com/dockette/devstack/blob/master/docker-compose.yml). The project uses the Docker Compose plugin command (`docker compose`) and keeps a legacy `docker-compose` fallback for older hosts.
6874
6975
```
7076
wget https://raw.githubusercontent.com/dockette/devstack/master/docker-compose.yml
@@ -75,17 +81,17 @@ If you didn't change the `DEVSTACK_DOCKER` variable, you should place your `dock
7581
After you've followed install section, your devstack should be well prepared. One thing left, you should configure your devstack (passwords, folders, etc).
7682
7783
You should:
78-
- setup your [**data homeland**](https://github.com/dockette/devstack/blob/master/docker-compose.yml#L132-L134)
79-
- setup MySQL [**root password**](https://github.com/dockette/devstack/blob/master/docker-compose.yml#L108-L110)
80-
- setup PostgreSQL [**root password**](https://github.com/dockette/devstack/blob/master/docker-compose.yml#L125-L127)
84+
- setup your [**data homeland**](https://github.com/dockette/devstack/blob/master/docker-compose.yml#L151-L153)
85+
- setup MySQL [**root password**](https://github.com/dockette/devstack/blob/master/docker-compose.yml#L125-L127)
86+
- setup PostgreSQL [**root password**](https://github.com/dockette/devstack/blob/master/docker-compose.yml#L144-L146) if you enable PostgreSQL
8187
8288
### Userdirs
8389
8490
There are two kind of users inside these containers, **root** (main unix user) and **dfx** (special user with uid 1000 in all `dockette` based images).
8591
86-
You can find it in docker-compose.yml [file in section/container](https://github.com/dockette/devstack/blob/master/docker-compose.yml#L139-L147).
92+
You can find it in docker-compose.yml [file in section/container](https://github.com/dockette/devstack/blob/master/docker-compose.yml#L155-L166).
8793
88-
On the containers startup, your `users dir` are attached to `php72`, `php56`, `nodejs` containers. You can create your own `.bash_profile`, `.bashrc` files
94+
On the containers startup, your `users dir` are attached to `php72` and to `php56`/`nodejs` when you enable those optional containers. You can create your own `.bash_profile`, `.bashrc` files
8995
for easier manipulation inside docker containers.
9096
9197
[**TIP**] There used to be a skeleton in ubuntu/debian/mint system.
@@ -125,9 +131,9 @@ MariaDB container has predefined IP address `172.10.10.20`.
125131
172.10.10.20 mariadb
126132
```
127133

128-
### PostgreSQL
134+
### PostgreSQL (optional)
129135

130-
PostgreSQL's default root password is `root`. You should change it.
136+
If you enable PostgreSQL, its default root password is `root`. You should change it.
131137

132138
You have to setup in you application/configs proper `host` which is `postgresql`.
133139

@@ -152,6 +158,9 @@ By default is devstack available on domains:
152158
- www.local.dev (php)
153159
- local.dev7 (php7)
154160
- www.local.dev7 (php7)
161+
162+
When you enable PHP 5.6, these domains are available too:
163+
155164
- local.dev56 (php56)
156165
- www.local.dev56 (php56)
157166

@@ -168,16 +177,19 @@ You should add these lines to your `/etc/hosts` file.
168177
169178
# Devstack [DB]
170179
172.10.10.20 mariadb
180+
# Optional PostgreSQL
171181
172.10.10.21 postgresql
172182
```
173183

174184
Give a try!
175185

176186
```
177187
ping local.dev
178-
ping local.dev56
179188
ping local.dev7
180189
ping mariadb
190+
191+
# Optional services
192+
ping local.dev56
181193
ping postgresql
182194
```
183195

devstack

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
DEVSTACK_PREFIX=${DEVSTACK_PREFIX:-devstack}
55
DEVSTACK_DOCKER=${DEVSTACK_DOCKER:-~/.devstack/docker-compose.yml}
66
DEVSTACK_USER=${DEVSTACK_USER:-dfx}
7+
DEVSTACK_SSH_AUTH_SOCK=${DEVSTACK_SSH_AUTH_SOCK:-/tmp/devstack-ssh-agent}
78
DEVSTACK_VERSION=1.3
89

910
# Functions
@@ -18,6 +19,7 @@ Environment:
1819
User: $DEVSTACK_USER
1920
Prefix: $DEVSTACK_PREFIX-[container]
2021
Configuration: $DEVSTACK_DOCKER
22+
SSH agent: ${SSH_AUTH_SOCK:-$DEVSTACK_SSH_AUTH_SOCK}
2123
2224
Commands:
2325
@@ -42,8 +44,18 @@ Commands:
4244
EOF
4345
}
4446

47+
compose() {
48+
if [ -n "$DEVSTACK_COMPOSE" ]; then
49+
$DEVSTACK_COMPOSE "$@"
50+
elif docker compose version >/dev/null 2>&1; then
51+
docker compose "$@"
52+
else
53+
docker-compose "$@"
54+
fi
55+
}
56+
4557
call() {
46-
docker-compose -p "$DEVSTACK_PREFIX" --file "$DEVSTACK_DOCKER" $*
58+
SSH_AUTH_SOCK=${SSH_AUTH_SOCK:-$DEVSTACK_SSH_AUTH_SOCK} compose -p "$DEVSTACK_PREFIX" --file "$DEVSTACK_DOCKER" "$@"
4759
}
4860

4961
up() {

0 commit comments

Comments
 (0)