Skip to content

Commit 508009e

Browse files
barakivacolisee
andauthored
chore(vscode): automated booting & logging of docker compose using vs… (#188)
* chore(vscode): automated booting & logging of docker compose using vscode tasks * Updated image version and added .env files * Removed unecessary .env files --------- Co-authored-by: Robin ALEXANDER <colisee@hotmail.com>
1 parent 4687308 commit 508009e

3 files changed

Lines changed: 119 additions & 6 deletions

File tree

.examples/docker/docker-compose-local.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
env_file:
1010
- db.env
1111
app:
12-
image: librebooking/librebooking:4.1.0
12+
image: librebooking/librebooking:develop
1313
restart: always
1414
depends_on:
1515
- db
@@ -20,7 +20,7 @@ services:
2020
env_file:
2121
- lb.env
2222
cron:
23-
image: librebooking/librebooking:4.1.0
23+
image: librebooking/librebooking:develop
2424
restart: always
2525
user: root
2626
entrypoint: /usr/local/bin/cron.sh

.examples/docker/docker-compose-public.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ services:
3636
- db_root_pwd
3737
- db_user_pwd
3838
lb1:
39-
image: librebooking/librebooking:4.1.0
39+
image: librebooking/librebooking:develop
4040
restart: always
4141
depends_on:
4242
- db
@@ -54,7 +54,7 @@ services:
5454
- lb_install_pwd
5555
- lb_user_pwd
5656
job1:
57-
image: librebooking/librebooking:4.1.0
57+
image: librebooking/librebooking:develop
5858
restart: always
5959
depends_on:
6060
- lb1
@@ -67,7 +67,7 @@ services:
6767
secrets:
6868
- lb_user_pwd
6969
lb2:
70-
image: librebooking/librebooking:4.1.0
70+
image: librebooking/librebooking:develop
7171
restart: always
7272
depends_on:
7373
- db
@@ -85,7 +85,7 @@ services:
8585
- lb_install_pwd
8686
- lb_user_pwd
8787
job2:
88-
image: librebooking/librebooking:4.1.0
88+
image: librebooking/librebooking:develop
8989
restart: always
9090
depends_on:
9191
- lb2

.vscode/tasks.json

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
// Logging
5+
{
6+
"label": "Logs: librebooking (docker)",
7+
"command": "docker compose --file docker-compose-local.yml logs app -f",
8+
"type": "shell",
9+
"options": {
10+
"cwd": "${workspaceFolder}/.examples/docker",
11+
"env": {
12+
"DOCKER_HOST": "unix:///run/docker.sock" // Sometimes the tasks shell doesnt inherit .bashrc DOCKER_HOST, neither the docker context
13+
}
14+
},
15+
"presentation": {
16+
"reveal": "always",
17+
"panel": "new"
18+
}
19+
},
20+
{
21+
"label": "Logs: db (docker)",
22+
"command": "docker compose --file docker-compose-local.yml logs db -f",
23+
"type": "shell",
24+
"options": {
25+
"cwd": "${workspaceFolder}/.examples/docker",
26+
"env": {
27+
"DOCKER_HOST": "unix:///run/docker.sock"
28+
}
29+
},
30+
"presentation": {
31+
"reveal": "always",
32+
"panel": "new"
33+
}
34+
},
35+
{
36+
"label": "Logs: cron (docker)",
37+
"command": "docker compose --file docker-compose-local.yml logs cron -f",
38+
"type": "shell",
39+
"options": {
40+
"cwd": "${workspaceFolder}/.examples/docker",
41+
"env": {
42+
"DOCKER_HOST": "unix:///run/docker.sock"
43+
}
44+
},
45+
"presentation": {
46+
"reveal": "always",
47+
"panel": "new"
48+
}
49+
},
50+
{
51+
"label": "Logs: all (docker)",
52+
"dependsOn": [
53+
"Logs: librebooking (docker)",
54+
"Logs: db (docker)",
55+
"Logs: cron (docker)"
56+
],
57+
"presentation": {
58+
"reveal": "always",
59+
"panel": "dedicated"
60+
},
61+
"problemMatcher": []
62+
},
63+
{
64+
"label": "Status: all (docker)",
65+
"command": "docker compose --file docker-compose-local.yml ps app db cron",
66+
"type": "shell",
67+
"options": {
68+
"cwd": "${workspaceFolder}/.examples/docker",
69+
"env": {
70+
"DOCKER_HOST": "unix:///run/docker.sock"
71+
}
72+
},
73+
"presentation": {
74+
"reveal": "always",
75+
"panel": "new"
76+
}
77+
},
78+
// Booting
79+
{
80+
"label": "Hard Restart: all (docker)",
81+
"command": "docker compose --file docker-compose-local.yml down --remove-orphans && docker compose --file docker-compose-local.yml up -d ",
82+
"options": {
83+
"cwd": "${workspaceFolder}/.examples/docker",
84+
"env": {
85+
"DOCKER_HOST": "unix:///run/docker.sock"
86+
}
87+
},
88+
"type": "shell"
89+
},
90+
{
91+
"label": "Start: all (docker)",
92+
"command": "docker compose --file docker-compose-local.yml up -d",
93+
"options": {
94+
"cwd": "${workspaceFolder}/.examples/docker",
95+
"env": {
96+
"DOCKER_HOST": "unix:///run/docker.sock"
97+
}
98+
},
99+
"type": "shell"
100+
},
101+
{
102+
"label": "Stop: all (docker)",
103+
"command": "docker compose --file docker-compose-local.yml down --remove-orphans",
104+
"options": {
105+
"cwd": "${workspaceFolder}/.examples/docker",
106+
"env": {
107+
"DOCKER_HOST": "unix:///run/docker.sock"
108+
}
109+
},
110+
"type": "shell"
111+
}
112+
]
113+
}

0 commit comments

Comments
 (0)