File tree Expand file tree Collapse file tree 4 files changed +40
-7
lines changed Expand file tree Collapse file tree 4 files changed +40
-7
lines changed Original file line number Diff line number Diff line change 1
- NETWORK_NAME = develop
1
+ NETWORK_NAME = my-project
2
+ PROJECT_NAME = my-project
Original file line number Diff line number Diff line change 2
2
3
3
* localhost:9080/ => ./htdocs as webroot folder
4
4
* localhost:9081/ => adminer
5
+ * localhost:9306 => external db connection (only needed for external access
6
+
7
+ > ** _ NOTE:_ ** from inside the network the database connection is db:3306!!
5
8
6
9
## Setup docker containers
7
10
@@ -31,3 +34,13 @@ When you're ready, start your application by running:
31
34
```
32
35
33
36
and save the file. This assumes you have your webroot in a folder htdocs as indicated above.
37
+
38
+ ## Setup database
39
+
40
+ To create a database and a user open in Adminer oder a vscode MariaDB plugin
41
+
42
+ ``` sql
43
+ create database my_database ;
44
+ create user ' my-user' @' %' identified by ' my-oassword' ;
45
+ grant all privileges on my_database.* to ' my-user' @' %' ;
46
+ ```
Original file line number Diff line number Diff line change 7
7
# You can add other services your application may depend on here, such as a
8
8
# database or a cache. For examples, see the Awesome Compose repository:
9
9
# https://github.com/docker/awesome-compose
10
- name : project-name
10
+ name : ${PROEJECT_NAME}
11
+ networks :
12
+ default :
13
+ name : ${NETWORK_NAME}
14
+
11
15
services :
12
16
server :
17
+ container_name : ${PROJECT_NAME}
18
+
13
19
build :
14
20
context : .
15
21
ports : ["9080:80"]
16
22
volumes : ["../htdocs/:/var/www/html"]
17
23
18
24
db :
25
+ container_name : ${PROJECT_NAME}-db
26
+
19
27
image : mariadb
20
28
restart : always
21
29
ports : ["9306:3306"]
22
30
environment :
23
31
MARIADB_ROOT_PASSWORD : geheim
24
32
25
33
adminer :
34
+ container_name : ${PROJECT_NAME}-adminer
35
+
26
36
image : adminer
27
37
restart : always
28
38
ports : ["9081:8080"]
29
-
30
- networks :
31
- default :
32
- name : ${NETWORK_NAME}
33
- external : true
Original file line number Diff line number Diff line change
1
+ {
2
+ "version" : " 0.2.0" ,
3
+ "configurations" : [
4
+ {
5
+ "name" : " Listen for Xdebug" ,
6
+ "type" : " php" ,
7
+ "request" : " launch" ,
8
+ "port" : 9003 ,
9
+ "pathMappings" : {
10
+ "/var/www/html" : " ${workspaceFolder}"
11
+ }
12
+ }
13
+ ]
14
+ }
You can’t perform that action at this time.
0 commit comments