Skip to content

Commit 99388af

Browse files
garrettwderickr
authored andcommitted
now everything starts up automatically
1 parent 56e0e28 commit 99388af

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.devcontainer/devcontainer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@
3131
],
3232

3333
// Use 'postCreateCommand' to run commands after the container is created.
34-
"postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html; test -f composer.json && composer install"
34+
"postCreateCommand": "sudo .devcontainer/post-create.sh && sudo chmod a+x \"$(pwd)\" && sudo ln -s \"$(pwd)\" /var/www/html",
35+
"waitFor": "postCreateCommand",
36+
"postAttachCommand": {
37+
"Server": "apache2ctl start"
38+
}
3539

3640
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
3741
// "remoteUser": "root"

.devcontainer/post-create.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
test -f composer.json && composer install
4+
5+
sed -i 's/Listen 80$//' /etc/apache2/ports.conf \
6+
&& sed -i 's/<VirtualHost \*:80>/ServerName 127.0.0.1\n<VirtualHost \*:8080>/' /etc/apache2/sites-enabled/000-default.conf \
7+
&& rm -rf /var/www/html

0 commit comments

Comments
 (0)