Skip to content

Commit ca15fee

Browse files
authored
Add more fix in Dev Container
1 parent df2330e commit ca15fee

File tree

5 files changed

+5311
-10
lines changed

5 files changed

+5311
-10
lines changed

.devcontainer/devcontainer.json

+9-6
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,21 @@
44
"dockerComposeFile": ["docker-compose.yml"],
55
"workspaceFolder": "/workspace",
66
"service": "app",
7+
"shutdownAction": "stopCompose",
78
"extensions": [
89
"editorconfig.editorconfig"
910
],
1011
"settings": {
1112
"terminal.integrated.shell.linux": "/bin/bash"
1213
},
1314
// Use 'forwardPorts' to make a list of ports inside the container available locally.
14-
"forwardPorts": [],
15+
"forwardPorts": [80, 8000],
1516

1617
// Use 'postCreateCommand' to run commands after the container is created.
17-
"postCreateCommand": "cp .env.example .env && composer install && yarn install && yarn run development",
18-
19-
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
20-
"remoteUser": "vscode"
21-
}
18+
"postCreateCommand": "cp .env.example .env && composer install && php artisan key:generate && yarn install && yarn run development",
19+
"portsAttributes": {
20+
"80": {
21+
"label": "HTTP"
22+
}
23+
},
24+
}

.devcontainer/docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ services:
1212
PHP_EXTENSION_XDEBUG: 1
1313
PHP_EXTENSION_PGSQL: 1
1414
PHP_EXTENSION_PDO_PGSQL: 1
15-
APACHE_DOCUMENT_ROOT: public/
15+
APACHE_DOCUMENT_ROOT: /workspace/public
1616
db:
1717
image: postgres:13
1818
restart: unless-stopped
@@ -29,4 +29,4 @@ services:
2929
mailhog:
3030
image: mailhog/mailhog
3131
ports:
32-
- 8025:8025
32+
- 8025:8025

.devcontainer/docker/app/Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
ARG PHP_EXTENSIONS="mysqli pgsql pdo_mysql pdo_pgsql"
22

33
FROM thecodingmachine/php:8.0-v4-apache-node12
4-
WORKDIR /var/www/html
5-
COPY --chown=docker:docker . /var/www/html
4+
WORKDIR /workspace

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ npm-debug.log
1313
yarn-error.log
1414
/.idea
1515
/.vscode
16+
public/css
17+
public/js
18+
public/mix-manifest.json

0 commit comments

Comments
 (0)